zii.widgets.grid.CGridView

<?php $this->widget('zii.widgets.grid.CGridView', $hooks->applyFilters('grid_view_properties', array( 'ajaxUrl' => $this->createUrl($this->route), 'id' => $pricePlansGenerator->modelName.'-grid', 'dataProvider' => $pricePlansGenerator->search(), 'emptyText' => Yii::t('ext_pricing_plan_generator','No results found. Click {here} to generate price plan', array( '{here}' => CHtml::link(Yii::t('app', 'here'), Yii::app()->createUrl("ext_price_plan_generator/generator")) )), 'filterPosition' => 'body', 'filterCssClass' => 'grid-filter-cell', 'itemsCssClass' => 'table table-hover', 'selectableRows' => 0, 'enableSorting' => false, 'cssFile' => false, 'pagerCssClass' => 'pagination pull-right', 'pager' => array( 'class' => 'CLinkPager', 'cssFile' => false, 'header' => false, 'htmlOptions' => array('class' => 'pagination') ), 'columns' => $hooks->applyFilters('grid_view_columns', array( array( 'class' => 'CCheckBoxColumn', 'name' => 'generator_id', 'disabled' => function() use ($pricePlansGroup){ return ($pricePlansGroup->isPublished && !$pricePlansGroup->hasErrors('published')); }, 'selectableRows' => 100, 'checked' => function($data, $row) use ($generator_ids) { return in_array($data->generator_id, $generator_ids); }, 'checkBoxHtmlOptions' => array('name' => "{$pricePlansGroup->modelName}[generators][]"), ), array( 'name' => 'price_plan.name', 'value' => function($data, $row){ echo CHtml::link($data->getPricePlan()->name, Yii::app()->createUrl("ext_price_plan_generator/generator", array("id" => $data->plan_id))); }, ), array( 'header' => Yii::t('price_plans', 'Price'), 'name' => 'price_plan.formattedPrice', ), array( 'name' => 'sending_quota', ), array( 'name' => 'markup_percentage', 'value' => function($data, $row){ $formatter = Yii::app()->numberFormatter; echo $formatter->formatPercentage($data->markup_percentage); }, ), ), $this), ), $this)); ?>
function($data, $row) use ($generator_ids) { return in_array($data->generator_id, $generator_ids); },
Note: use ( outside_variable ) = to use the outside variable inside the annon function

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.