在布局中输出附加数据(Yii)

For some pages of my application, I would like to use dvuhkolonchaty template. For this I would like to just use a different layout.

In the new layout except the variable $content, which displays the contents of a particular view, I would like to withdraw more other data in another column. Here is the code of the new layout:

<?php /* @var $this AdminController */ ?>
<?php $this->beginContent('/layouts/main'); ?>
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span4">
         <!-- Any data -->
      </div>
      <div class="span8">
        <?php echo $content; ?>
      </div>
    </div>
  </div>

<?php $this->endContent(); ?>

And that's just where Any data, I would like to display a different not template information (eg, shape or edit the list of properties is constantly changing depending on the viewing record ID).

Q How can I print information in the Any data?

All your controllers will extends Controller class; In the Controller class, you make a property like this:

public $anyData  = null;

In your any actions, you can set `$this->anyData = "anything";

then in your layout, you can write :

<div class="span4">
     <!-- Any data -->
     <?php 
     if($this->anyData!=null)  { 
          //Process $this->anyData here, echo or do something you like; 
     } 
     ?>
 </div>