[symfony-users] Re: How to make Ajax urls environment aware?

2010-05-25 Thread Richtermeister
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

[symfony-users] Re: How to make Ajax urls environment aware?

2010-05-25 Thread Richtermeister
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