How To Add Toggle Button In Yii Operations Coloumn

array(

            'class' => 'CButtonColumn',


            'header' => 'Operations',


            'template' => '{punchin}',


            'buttons'=>array(


                    'punchin' => array(


                            'label'=>'punch in', // text label of the button


                            'url'=>"CHtml::normalizeUrl(array('punchin', 'id'=>\$data->id))",


                            'id'=>'punch',


                            'imageUrl'=>'C:/xampp/htdocs/web/images/copy.png', 


							


						


                    ),


            ),


    ),

i need toggle button as punch in and punch out…how can i add this

plssssssssss help me…

If the question is that you need to conditionally show a "punch in" button or a "punch out" button based on a users current state take a look at the "visible" property of CButtonColumn. It allows you to set a conditional statement for each template to determine if it should be shown or not.

This topic may also be of some use:

http://www.yiiframework.com/forum/index.php/topic/12493-cbuttoncolumn-set-template-under-condition/