0
在視圖中我有這樣的foreach用於產生鏈接CakePHP的:產生在一個菜單鏈接
<ul class="nav">
<?php foreach($menus as $k => $menu): ?>
<li>
<a href="information/index/<?php echo $menu['Menu']['slug']; ?>">
<i class="<?php echo $menu['Menu']['icon-type']; ?> icon-large"></i>
<?php echo $menu['Menu']['name']; ?>
</a>
</li>
<?php endforeach ?>
</ul>
這給
- 門
- MenuB
- MenuC
所以我可以訪問本地主機/文件夾/信息/索引/菜單A 我有一個問題,這條線
<a href="information/index/<?php echo $menu['Menu']['slug']; ?>">
每次在菜單上點擊該鏈接將被增加的控制器和行動
http://localhost/folder/information/index/information/index/menuA
您應該使用CakePHP的菜單助手,或者至少是使用的HtmlHelper創建你的鏈接... http://bakery.cakephp.org/articles/alkemann/2009/02/04/menuhelper –
Thks Scrowler的信息! –
那麼,具體的問題是什麼? –