[symfony-users] Re: "Injecting" values in the new forms

2008-12-09 Thread juro
Ok, Symfony seems to keep it persistent. Your code works well, except that the functions $this->setCreatedBy() expects an object as parameter. $user->getId() is an integer. So either $this->set('created_by', $user->getId()); or $this->setCreatedBy($user); works. Thank you! --~--~-~--

[symfony-users] Re: "Injecting" values in the new forms

2008-12-08 Thread juro
I hear you regarding bad practice - would be good to get some information from one of the head dev honchos on that. Can Symfony keep the sessions apart, i.e. does Symfony "know" who is invoking the save() method? On Dec 5, 11:11 pm, Ant Cunningham <[EMAIL PROTECTED]> wrote: > Save it in the se

[symfony-users] Re: "Injecting" values in the new forms

2008-12-05 Thread Ant Cunningham
Save it in the session... Then pull from that. You can access the sfUser, and by extension the sfGuardUser and sfGuardUserProfile from anywhere within an application. The easiest way to do this depends on what layer youre in and what Objects you have at your disposal in current scope. But the

[symfony-users] Re: "Injecting" values in the new forms

2008-12-05 Thread juro
Yes, definitely the more elegant version. The question being, how do I get the user's id that invokes the save() method inside the object's instance itself? Any idea? juro On Dec 5, 4:36 pm, Ant Cunningham <[EMAIL PROTECTED]> wrote: > You could do it this way but similar to the conversation abou

[symfony-users] Re: "Injecting" values in the new forms

2008-12-05 Thread Ant Cunningham
You could do it this way but similar to the conversation about CartIds for a shoppping cart i dont think you want this on the form. I would modify the updateObject and save methods of the form in question or maybe perhaps the the save method of the objects themselves. Gareth McCumskey wrote:

[symfony-users] Re: "Injecting" values in the new forms

2008-12-05 Thread Gareth McCumskey
Create hidden fields for each of these types then use the form class's ability to set defaults for fields to dynamically populate them? On Fri, Dec 5, 2008 at 11:32 AM, juro <[EMAIL PROTECTED]> wrote: > > Hi, > using the new forms, how can I assign values to fields not populated > through the for