if ($u = $this->generateUrl('_'.$specific.'_thanks'))
return $this->redirect($u);
else
return $this->redirect($this->generateUrl('_thanks'));
我不想重定向到_specific_thanks
url时它存在。那么如何检查一个url是否存在?重定向之前检查网址symfony2
当我这样做,我有这个错误:
Route "_specific_thanks" does not exist.
完美的它为我工作!只要'$ this-> container-> get('router');'用symfony 2.1.4 – Harold
太好了!我更新了答案,以便它符合sf 2.1.4 :) $ this-> get('router')也可以工作,我认为。 –