This method is called for each button and each row.
public createUrl ( string $action, |
||
$action | string | the button name (or action ID) |
$model | the data model | |
$key | mixed | the key associated with the data model |
$index | integer | the current row index |
Результат | string | the created URL |
public function createUrl($action, $model, $key, $index) { if (method_exists($model, 'getUrl') && ($url = $model->getUrl($action)) && !$this->urlCreator) { return $url; } else { return parent::createUrl($action, $model, $key, $index); } }
public function createUrl($action, $model, $key, $index) { switch ($action) { case 'view': $action = 'read-form'; break; case 'update': $action = 'update-form'; break; case 'delete': $action = 'delete-form'; break; } return parent::createUrl($action, $model, $key, $index); }