symfony 1.4 routing



我的路由有问题,因此任何帮助都将不胜感激吗?

我将如何为以下内容设置路由规则:

 /MyUrl/edit/
 /MyUrl/edit/[something]

,[某物]被以变量发送。

我正在使用Symfony 1.4在Propel中进行此操作。

谢谢

我建议您阅读教程 - JobEet

yourFirstRout:  
  url:   /yourFirstRout/edit
  param: { module: yourModule, action: edit }
yourSecondRout:  
  url:   /yourSecondRout/edit/:something
  param: { module: yourModule, action: editEntry }

某物 - 是一个参数,例如ID。在Action editentry 中,您可以从请求中获得此参数:

$something = $request->getParameter('something');

然后您可以通过此参数在DB条目中搜索。

最新更新