Difference between #1 and #2 of
Yii 1.1: Cgridview: Use Special Variable $Data In The Options Of A Button (I.e. Evaluate Options Attribute)

Revision #2 has been created by Louis Gac on Jul 2, 2014, 4:46:49 PM with the memo:

added isset in condition to avoid php notice when evaluateOptions is not used
« previous (#1)

Changes

Title unchanged

Yii 1.1: Cgridview: Use Special Variable $Data In The Options Of A Button (I.e. Evaluate Options Attribute)

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

CGridView, CButtonColumn, ButtonColumn, form, inputevaluate, htmlOptions, understanding

Content changed

[...]
$options=isset($button['options']) ? $button['options'] : array();
if(!isset($options['title']))
$options['title']=$label;

// Start of modification
if(
 isset ( $options['evaluateOptions'] ) )
{
foreach( $options['evaluateOptions'] as $key=>$value)
{
$options[$value] = $this->evaluateExpression($options[$value],array('data'=>$data,'row'=>$row));
}
[...]
3 0
4 followers
Viewed: 23 198 times
Version: 1.1
Category: Tutorials
Written by: Louis Gac
Last updated by: Louis Gac
Created on: Jun 17, 2014
Last updated: 10 years ago
Update Article

Revisions

View all history