Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Add two model to a Fieldset
Syntaxlb
December 2013
Hi,
I want to add two model to a fieldset :
$form = \Fieldset::forge('page_form', array('form_atributes' => array('class' => 'form-horizontal')));
$form->add_model('Model_Page');
$form->add_model('Model_Horaires');
But i have this notice :
Notice:
Field with this name exists already in this fieldset: "created_at". in PKGPATH/orm/classes/observer/validation.php [144]: add
Notice:
Field with this name exists already in this fieldset: "updated_at". in PKGPATH/orm/classes/observer/validation.php [144]: add
It's okay because i have twice "updated_at" and "created_at" in Model_Page and Model_Horaire.
But what i can do ?
My idea : Remove created_at and updated_at field after the first add_model(). But Fieldset class doesn't have a remove method ?
Syntaxlb
December 2013
I've resolve my issue :
$form = \Fieldset::forge('page_form', array('form_atributes' => array('class' => 'form-horizontal')));
$form->add_model('Model_Page');
$formHoraire = \Fieldset::forge('horaire_form');
$formHoraire->add_model('Model_Horaires');
$form->add($formHoraire);
Sorry for this post
;-)
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,089
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
261
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Syntaxlb
December 2013