You passed the user object as the first parameter – please read my email again. 
:) The first parameter has to be an Events object or null.


Cheers, Daniel

On 14.12.2010, at 15:57, P-A Coipeault wrote:

> Hi Daniel.
> 
> I tried to instanciate my form the way you suggested but i only get
> that 500 error : The "EventsForm" form only accepts a "Events" object.
> I also tried another way, by overriding the executeNew() method and
> assigning my user object to the form object like that :
> $this->form->user = $this->getUser()->getGuardUser();
> 
> But i don't recover my user object when the form is displayed.
> 
> If you have any idea, that will be very useful.
> 
> Regards!
> P-A
> 
> On Dec 14, 1:42 am, P-A Coipeault <pcoipea...@gmail.com> wrote:
>> Thanks a lot Daniel !
>> That's really helpfull :)
>> 
>> So, one point resolved above two is resolved.
>> Thanks again.
>> 
>> Cheers,
>> P-A
>> 
>> On Dec 14, 12:25 am, Daniel Lohse <annismcken...@googlemail.com>
>> wrote:
>> 
>>> You can pass the user as an option to the form from the action — just pass 
>>> an array as the second parameter of the form instanciation like so:
>> 
>>> $form = new <modelname>Form($object or null, array('user' => 
>>> $this->getUser()->getGuardUser());
>> 
>>> And then in the form's configure() method you can get the user with: 
>>> $this->getOption('user').
>> 
>>> Cheers, Daniel
>> 
>>> Sent from my iPhone4
>> 
>>> On Dec 13, 2010, at 6:53 PM, P-A Coipeault <pcoipea...@gmail.com> wrote:
>> 
>>>> Hello everyone.
>> 
>>>> I'm using sf1.4 with Doctrine ORM.
>> 
>>>> I'm facing some kind of problems.
>>>> I've got a backend app generated, with tables acting as i18n.
>>>> No problems with that, everything works fine, as soon as it stays in
>>>> standard.
>> 
>>>> Due to ergonomic and functionnality requirements made by the customer,
>>>> i've to simplify to the maximum the "edit" and "new" forms.
>>>> To do that i wanted to use partial.
>>>> But as i declare the partials in the "form"->"display" in the
>>>> generator.yml, the i18n fields in the form don't appear anymore, even
>>>> if i try to declare them in the "display" in the generator
>> 
>>>> Moreover, this backend app would be editable by languages admins.
>>>> I mean that they could only edit the language they're allowed to. I've
>>>> build my credentials and sfDoctrineGuard to make this work, but in my /
>>>> lib/forms/doctrine/<modelname>Form.class.php, i can't use $sf_user or
>>>> $this->getGuardUser to allow or not the use of i.e. : $this-
>>>>> widgetSchema->setLabel('en', 'English');
>> 
>>>> If you need more information or code snippets, i can provide some to
>>>> figure it better.
>>>> Thanks for your help !
>> 
>>>> Kind regards,
>>>> P-A Coipeault
>> 
>>>> --
>>>> If you want to report a vulnerability issue on symfony, please send it to 
>>>> security at symfony-project.com
>> 
>>>> You received this message because you are subscribed to the Google
>>>> Groups "symfony users" group.
>>>> To post to this group, send email to symfony-users@googlegroups.com
>>>> To unsubscribe from this group, send email to
>>>> symfony-users+unsubscr...@googlegroups.com
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/symfony-users?hl=en
> 
> -- 
> If you want to report a vulnerability issue on symfony, please send it to 
> security at symfony-project.com
> 
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to