现在的位置: 首页 > 综合 > 正文

Using url_for() in an Action

2012年05月26日 ⁄ 综合 ⁄ 共 584字 ⁄ 字号 评论关闭

简介:这是Using url_for() in an Action的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。

class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=343147' scrolling='no'>

原文: http://rndm-snippets.blogspot.com/2010/10/using-urlfor-in-action-symfony.html

In an symfony template you can get the base url of the application with:

url_for('@homepage', true);  

Using this code in an action causes:
Fatal error: Call to undefined function url_for() in ...
In an action this code should be used instead:

$baseUrl = $this->getController()->genUrl('@homepage', true); 


爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

http://biancheng.dnbcw.info/php/343147.html pageNo:5

抱歉!评论已关闭.