setModel() public method

public setModel ( string | Model $model, array $fields = null, array $grid_fields = null ) : AbstractModel
$model string | Model Same as parent
$fields array Specify list of fields for form and grid
$grid_fields array Overide list of fields for the grid
return AbstractModel $model
示例#1
0
 function setModel($m, $f = null, $f2 = null)
 {
     parent::setModel($m, $f, $f2);
     if ($this->add_button) {
         $this->add_button->setLabel('Add ' . str_replace(array('Model_', '_'), array('', ' '), get_class($this->model)));
     }
 }