내가 작업의 URL을 생성 할에 URL을 생성하지만 유형의 잘못된 URL을 얻을 :은 심포니 1.4 작업
./symfony/user/edit/id
내가 필요로 할 때
/user/edit/id
내 첫 번째 시도했다 : this answer 다음
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));
// ...
}
내 두 번째 시도는, 같은 잘못된 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));
// ...
}
어떻게하면 올바른 URL을 얻을 수 있습니까?
감사 솔루션은 ... –
이상한 ... 작동하지 않습니다 조각, 정확히 같은 결과를 시도 할 것이다 (또한 절대 URL로, 같은 잘못된 URL을) 나를 위해 작동하지 않습니다. –