You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Felice Ostuni edited this page Mar 18, 2015
·
5 revisions
DataForm/Edit supports insertValue() and updateValue() to prefill values on creation and modify.
there is also an "auto" field type that works directly on model, without output.
//default checked checkbox (on creation)$edit->add('visible','Abilitato','checkbox')->insertValue(1);
//default values for hidden fields$edit->add('parent_id', '', 'hidden')->insertValue($parent_id);
$edit->add('updated', '', 'hidden')->updateValue(date());
//set a value directly on model without using output$edit->add('parent_id', '', 'auto')->insertValue($parent_id); //or$edit->set('parent_id', $parent_id);