我尝试添加使用CakePHP的一个页面链接:添加网页链接CakePHP中
<?php echo $html->link('Home', '/notes/index');?>
它似乎并没有输出正确的链接。
我要的是这样的:
<a href="/cake/cake_startab/notes/index/" alt="Home">Home </a>
我怎样才能做到这一点?
我尝试添加使用CakePHP的一个页面链接:添加网页链接CakePHP中
<?php echo $html->link('Home', '/notes/index');?>
它似乎并没有输出正确的链接。
我要的是这样的:
<a href="/cake/cake_startab/notes/index/" alt="Home">Home </a>
我怎样才能做到这一点?
你要使用URL阵列
<?php echo $html->link('Home', array('controller'=>'notes','action'=>'index')); ?>
这会为你工作。您将无法使用绝对路径:)
退房的手册页,http://api.cakephp.org/class/html-helper#method-HtmlHelperlink
你将需要解释更多。你在使用内容系统或框架吗?链接函数中的代码是什么? – 2010-04-27 11:25:46
这是一个问题? – 2010-04-27 11:26:29
我使用cakephp – rajesh 2010-04-27 11:27:13