Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

How to display more than one example per page

giovdk21 edited this page Oct 13, 2012 · 1 revision
<div class="example_title">Breadcrumbs Example #1</div>

<?php 
Yii::app()->sc->setStart(__LINE__);

$this->breadcrumbs =array(
	'Interface',
	'Other'=>array('ui_other/index'),
	'Breadcrumbs'=>'http://www.yiiframework.com/doc/api/CBreadcrumbs',
);

Yii::app()->sc->collect('php', Yii::app()->sc->getSourceToLine(__LINE__, __FILE__)); 

Yii::app()->sc->collect('php', Yii::app()->sc->getSnippetFromFile(
	"<?php \$this->widget('zii.widgets.CBreadcrumbs",
	"<!-- breadcrumbs -->",
	"protected/views/layouts/main.php"),
	false, true
);

Yii::app()->sc->renderSourceBox(); // we call here the renderSourceBox() method to printOut the collected source and flush the collected source array.
?>


<div class="example_title">Breadcrumbs Example #2</div>

<?php
Yii::app()->sc->setStart(__LINE__);

$this->breadcrumbs =array(
	'Interface',
	'Other'=>array('ui_other/index'),
	'Breadcrumbs'=>'http://www.yiiframework.com/doc/api/CBreadcrumbs',
);

Yii::app()->sc->collect('php', Yii::app()->sc->getSourceToLine(__LINE__, __FILE__));

// [...]

// we don't call renderSourceBox() here as it will be called from the layout
?>

My Sidebar

Clone this wiki locally