我是CakePHP的新手;
點擊每個菜單後,URL地址欄總是被添加;URL總是附加? CakePHP
我定義我的路線如下:
Router::connect('/brand/*', array('controller' => 'phones', 'action' => 'phonebybrand'));
這是我的菜單:
<?php
foreach ($phonebrands as $phonebrand):
echo '<li><a href="brand/{$phonebrand['Phonebrand']['id']}">{$phonebrand['Phonebrand']['brandname']}</a></li>';
endforeach;
?>
我試圖點擊我多次菜單;我發現的是始終追加的URL;
第一次:localhost/cakephp-2.3.2/brand/43
第二次:localhost/cakephp-2.3.2/brand/brand/43
第三次:localhost/cakephp-2.3.2/brand/brand/brand/43
請幫助我,爲什麼它總是附加url?
謝謝。
你是如何創建菜單?你能顯示一些代碼嗎? – Nunser 2013-05-03 15:01:20
也許向我們展示鏈接是如何生成的?其實我們只是用心靈感應 – Ryan 2013-05-03 15:02:10
加上你的菜單代碼.. – 2013-05-03 15:07:30