Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.63 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Use a widget in a statically-called method
  2. $this->widget('zii.widgets.grid.CGridView', array(
  3.     'dataProvider' => $model->search(),
  4.     'columns' => array(
  5.         array(
  6.             'name' => 'attrName',
  7.             'value' => '--USE WIDGET HERE--',
  8.         ),
  9.     )
  10. ));
  11.        
  12. $this->widget('zii.widgets.grid.CGridView', array(
  13.     'dataProvider' => $model->search(),
  14.     'columns' => array(
  15.         array(
  16.             'name' => 'attrName',
  17.             'value' => function ($data, $row, $column) {
  18.                 $controller = $column->grid->owner;
  19.                 $controller->widget(/* ... etc ... */);
  20.             },
  21.         ),
  22.    )
  23. ));