This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » symfony 1.3 and 1.4 » one model with different forms
one model with different forms [message #103291] Fri, 30 July 2010 12:59 Go to next message
imsashko  is currently offline imsashko
Messages: 4
Registered: January 2010
Location: Ukraine
Junior Member
Hi, I have a problem with handling one model with different forms. I need to use one form with 5 fields in frontend and it already looks like this:
class ClientForm extends BaseClientForm
{
  public function configure()
  {
     $this->useFields(array(
...
     ));
     
     $this->setValidators(array(...));
  }
}

But also I need to handle the same model with nearly 10 fields in backend which was created using admnigenerator.
I've tried to create module for the model but with different name (ex. CClient).
In this case I copied and pasted generated basic forms and models with other names. It almost helped and in the backend I can see the list of records, but "edit" still doesn't work. I get message like this: "The "CClientForm" form only accepts a "Client" object."
Can you give me any advice about solution of problem or proper implementation?
Re: one model with different forms [message #103321 is a reply to message #103291 ] Fri, 30 July 2010 20:46 Go to previous messageGo to next message
fmeynard  is currently offline fmeynard
Messages: 2
Registered: July 2010
Location: Bordeaux
Junior Member
Let your frontend form class in lib/form and put one in apps/backend/lib for you backend Smile

Symfony will autoload apps/backend/lib first Smile
Re: one model with different forms [message #103325 is a reply to message #103291 ] Fri, 30 July 2010 21:35 Go to previous message
imsashko  is currently offline imsashko
Messages: 4
Registered: January 2010
Location: Ukraine
Junior Member
Thank you very much Smile I've put classses into the frontend lib directory and it's good, now I'm happy Very Happy
Previous Topic:Doctrine actAs: i18n
Next Topic:Pure M:N Form
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software