I have to generate an URL in a task but I get an incorrect url of type:
./symfony/user/edit/id when I need
/user/edit/id My first try was:
protected function execute($arguments = array(), $options = array()) { $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', $options['env'], true); $this->context = sfContext::createInstance($configuration); $baseurl = $this->context->getController()->genUrl(array('module' => 'user','action' => 'edit', 'id' => $id)); // ... } My second try, following this answer gives the same incorrect url:
protected function execute($arguments = array(), $options = array()) { $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', $options['env'], true); $this->context = sfContext::createInstance($configuration); $routing = $this->context->getRouting(); $baseurl = $routing->generate('user_edit', array('id' => $id)); // ... } How can I get the correct URL ?