0
我有這樣的路線設置,並手動輸入URL的工作原理:CakePHP的路線 - 生成appropiate鏈接,/:控制器/:ID /使用HTML幫助
Router::connect('/:controller/:id/*',
array('action' => 'view'),
array('pass'=>array('id'), 'id' => '[0-9]+'));
然而,隨着HTML的「鏈接,我如果沒有采取行動,則無法生成鏈接。
$this->Html->link('linkName', array(
'controller' => 'controllerName',
'action' => 'view',
$id, $slug));
產生controllerName /視圖/ ID
$this->Html->link('linkName', array(
'controller' => 'controllerName',
$id, $slug));
產生controllerName /索引/ ID
我怎麼能生成HTML輔助鏈接控制器/ ID?
謝謝!