A
A
Alexander2015-05-22 15:00:47
Yii
Alexander, 2015-05-22 15:00:47

How to correctly set the button url in the widget?

<?php $this->widget('bootstrap.widgets.TbGridView', array(
    'type'=>'striped bordered condensed',
    'dataProvider'=>$model->searchEmployees(),
    'columns'=>array(
        'id',
        'full_name_ru',
        array('name' => 'position_type','value'=> '$data->getPositionType()[$data->position_type]'),
        'work_phone',
        'home_phone',
        array(
            'class'=>'bootstrap.widgets.TbButtonColumn',
            'htmlOptions'=>array('style'=>'width: 50px'),
          'updateButtonUrl' => array('href' => '/RefEmployeesMahala/update/1'),
        ),
    )
)); ?>

Hello everyone, I can’t give the url of the update button in the admin panel, here I set 'updateButtonUrl' => array('href' => '/RefEmployeesMahala/update/1'),
Error in the browser
call_user_func_array() expects parameter 1 to be a valid callback, array must have exactly two members
Yii1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
George, 2015-05-22
@kentuck1213

'updateButtonUrl'=>'Yii::app()->createUrl("/RefEmployeesMahala/update", array("id"=>$data["id"]))',

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question