Even if you can pass null there, I'd still recommend array() to avoid E_NOTICE messages thrown because of sfForm's line 703 [1] Fási is a hungarian name, and that's actually my last name - we write names in a different order than most of the world, that's why it's in all-caps :P
[1] http://trac.symfony-project.org/browser/branches/1.2/lib/form/sfForm.class.php#L703 On Sat, Apr 11, 2009 at 17:40, dziobacz <[email protected]> wrote: > > so I think it is more correct now: > $this->form = new ChangeForm(NULL, array('parametr1' => > 'Michael')); > > Thx FASI (?? - what a name hehe), Michael and sid for help :) > > > > > > On 11 Kwi, 17:23, FÁSI Gábor <[email protected]> wrote: >> I don't know what $object is, I tend to use array() there (the default >> value for that parameter), but besides this your code seems fine. >> >> On Sat, Apr 11, 2009 at 17:00, dziobacz <[email protected]> wrote: >> >> > so in action.class.php: >> > $this->form = new ChangeForm($object, array('parameter1' => >> > 'Michael')); >> >> > in Form: >> > class ChangeForm extends sfForm >> > { >> >> > public function configure() >> > { >> > $a = $this->getOption('parameter1'); >> > ..................................... >> >> > is it ok ? >> >> > On 11 Kwi, 15:53, FÁSI Gábor <[email protected]> wrote: >> >> The second parameter of the default constructor[1] is an array called >> >> $options. You can use that to pass config settings to the form, and >> >> get them via sfForm's getOption()[2]. >> >> >> [1]http://www.symfony-project.org/api/1_2/sfForm#method___construct >> >> [2]http://www.symfony-project.org/api/1_2/sfForm#method_getoption >> >> >> On Sat, Apr 11, 2009 at 15:24, dziobacz <[email protected]> wrote: >> >> >> > I action.class.php I have: >> >> > $this->form = new Change_dataForm("Michael"); >> >> >> > And in Form: >> >> > private $something; >> >> >> > public function __construct($name) >> >> > { >> >> > $something = $name; >> >> > } >> >> >> > But I have an error: >> >> > Fatal error: Call to a member function getDefaults() on a non-object >> >> >> > WHY ?? >> >> > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
