Question

by default the CRUD add button name is the same as model name. how can we change that?

$tabs->addTab('Users')->add('CRUD')->setModel('Admin_User');
Was it helpful?

Solution

If you can - first set the model caption properly

Set $model->$caption of your model.

If it's just the CRUD which needs to have custom button name, then

Set $crud->entity_name either by extending or by specifying second parameter to add('CRUD')

Finally if you want to change it after crud->setModel()

You can access button through $crud->add_button, and use either set() or setLabel().

OTHER TIPS

$tab = $tabs->addTab('Users');
$crud = $tab->add('CRUD');
$crud->setModel('Admin_User');
$crud->entity_name = 'Text to be shown at Add button';

Or

$tab = $tabs->addTab('Users');
$crud = $tab->add('CRUD');
$crud->setModel('Admin_User');
$crud->add_button->set('Text to be shown at Add button');

OR

$this->add('CRUD',array('entity_name' => 'Text to be shown at Add button'));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top