But I want also 'description' for i18n but on the other page with
other form. I need two international forms for 'address' and
'description' but I think it isn't possible - all international fields
must be on the same form :/ ok so I could create NORMAL the easiest
form with these two fields:
class ContactForm extends BaseFirmForm
{
public function configure()
{
$this->embedI18n(array('pl', 'en'));
$this->widgetSchema->setLabel('pl', 'Polish');
$this->widgetSchema->setLabel('en', 'English');
}
}
And action:
public function executeEdit_contact(sfWebRequest $request)
{
$firm = Doctrine::getTable('Firm')->find($this->id_firm);
$this->form = new ContactForm($firm);
if ($request->isMethod('post'))
{
$this->form->bind($request->getParameter($this->form-
>getName()));
if ($this->form->isValid())
{
$this->form->save();
}
}
}
But after submit form, data aren't save in database, why ???????
On 8 Lis, 13:40, David Ashwood <[email protected]> wrote:
> Remove the description from the fields listed in I18n, build-all,
> clear-cache.
>
> On Sun, 2009-11-08 at 03:27 -0800, dziobacz wrote:
> > I have schema.yml:
> > Firm:
> > actAs:
> > I18n:
> > fields: [description, address]
> > columns:
> > id_firm:
> > type: integer(1)
> > primary: true
> > autoincrement: true
> > email:
> > type: string(100)
> > notnull: true
> > description:
> > type: clob
> > notnull: true
> > address:
> > type: clob
>
> > Symfony generated for me tables:
> > firm:
> > id_firm
> > email
>
> > firm_translation:
> > id_firm
> > description
> > address
> > lang
>
> > Nobody know how I can unset i18n field 'description' ?
>
> > On 7 Lis, 14:53, dziobacz <[email protected]> wrote:
> > > I have table Firm with columns:
> > > id_firm
> > > description
> > > contact
>
> > > I want 1 textarea in polish for column 'contact' and 1 textarea in
> > > english for column 'contact'. I would like to create form to edit
> > > column 'contact' so I read this
> > > site:http://www.symfony-project.org/jobeet/1_2/Doctrine/en/19
> > > on which was used method configure() to configure form. I would like
> > > to use method setUp() to build form by myself so I have made something
> > > like that:
>
> > > class ContactForm extends sfFormDoctrine
> > > {
> > > public function setUp()
> > > {
> > > $this->embedI18n(array('pl', 'en'));
> > > $this->widgetSchema->setLabel('pl', 'Polish');
> > > $this->widgetSchema->setLabel('en', 'English');
>
> > > $this->widgetSchema['contact'] = new sfWidgetFormTextarea();
> > > $this->widgetSchema['contact']->setAttribute('rows', 20);
> > > $this->widgetSchema['contact']->setAttribute('cols', 80);
>
> > > $this->widgetSchema->setNameFormat('data[%s]');
> > > }
>
> > > public function getModelName()
> > > {
> > > return 'Firm';
> > > }
>
> > > }
>
> > > but $this->embedI18n(array('pl', 'en')); generates 1 textarea in
> > > polish for column 'description', 1 in polish for column 'contact', 1
> > > textarea in english for column 'description' , 1 in english for column
> > > 'contact' + 1 textarea without language for column 'contact', why ? I
> > > want only 1 textarea in polish for column 'contact' and 1 textarea in
> > > english for column 'contact'.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---