How To Add Toggle Button In Yii Operations Coloumn


            'class' => 'CButtonColumn',

            'header' => 'Operations',

            'template' => '{punchin}',


                    'punchin' => array(

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

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








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: