Sorry, accidentally submitted.. if((!$routing = $this -> getOption("routing")) || !$routing instanceof sfRouting) { throw new sfException("You have to pass a routing object to ".get_class($this)); }
something along those lines.. Alternatively, you just inject the url directly.. $form = new WhateverForm($defaults, array("url" => $this -> generateUrl(...))); Daniel On May 25, 6:07 pm, Richtermeister <nex...@gmail.com> wrote: > Hey Kay, > > the clean way is to pass the routing class to the form. > > //from inside controller > $form = new WhateverForm($defaults, array("routing" => $this -> > getRouting()); > > //from inside form > $routing = $this -> getOption("routing"); > $url = $routing -> generate(...); > > ideally, you also ensure that you actually pass a routing object like > so: > > if((!$routing = $this -> getOption("routing")) || !$routing instanceof > sfRouting) > { > > } > > On May 24, 7:16 pm, KAy <kamil.kras...@gmail.com> wrote: > > > How to make ajax urls environment aware? > > (How to call url_for() inside widget/form configure() ?) > > > -- > > 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 > > athttp://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