Difference between #1 and #2 of
Dynamic Sidebar using CClipWidget

Revision #2 has been created by Cozumel on Dec 7, 2013, 8:36:48 AM with the memo:

closed the divs, for all the copy/paste monkeys out there
« previous (#1)

Changes

Title unchanged

Dynamic Sidebar using CClipWidget

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

sidebar, dynamic, CClipWidget, output buffering

Content changed

[...]
Then, in each your views just use the following:


```php
<?php $this->beginWidget('system.web.widgets.CClipWidget', array('id'=>'sidebar')); ?>
<div>Some non-common output<
/div> <?php $this->widget('application.components.widgets.SomeReusableWidget'); ?> <div>Some more non-common output</div>
<?php $this->endWidget();?>
```
[...]
```php
<?php ob_start(); ?>
<div>Some non-common output<
/div> <?php $this->widget('application.components.widgets.SomeReusableWidget'); ?> <div>Some more non-common output</div> <?php $this->sidebar = ob_get_clean(); ?> ``` Whichever of these ways you choose to do it, it's better than lots of if statements in your column2.php layout file or repeating the layout in each view file!
18 0
18 followers
Viewed: 54 530 times
Version: 1.1
Category: How-tos
Written by: Sheldmandu
Last updated by: Cozumel
Created on: Jan 2, 2011
Last updated: 10 years ago
Update Article

Revisions

View all history