有什麼辦法可以將以下規則合併爲一個規則?鞏固CakePHP路線
Router::connect('/manufacturer/:manufacturer/:friendly0', array('controller'=>'categories', 'action'=>'view'), array('pass'=>array('manufacturer', 'friendly0')));
Router::connect('/manufacturer/:manufacturer/:friendly0/:friendly1', array('controller'=>'categories', 'action'=>'view'), array('pass'=>array('manufacturer', 'friendly0', 'friendly1')));
Router::connect('/manufacturer/:manufacturer/:friendly0/:friendly1/:friendly2', array('controller'=>'categories', 'action'=>'view'), array('pass'=>array('manufacturer', 'friendly0', 'friendly1', 'friendly2')));
Router::connect('/manufacturer/:manufacturer/:friendly0/:friendly1/:friendly2/:friendly3', array('controller'=>'categories', 'action'=>'view'), array('pass'=>array('manufacturer', 'friendly0', 'friendly1', 'friendly2', 'friendly3')));
Router::connect('/manufacturer/:manufacturer/:friendly0/:friendly1/:friendly2/:friendly3/:friendly4', array('controller'=>'categories', 'action'=>'view'), array('pass'=>array('manufacturer', 'friendly0', 'friendly1', 'friendly2', 'friendly3', 'friendly4')));
Router :: connect('/ manufacturer /:manufacturer /:friendly0/* – benhowdle89
不幸的是,這將無法正常工作,因爲我有許多需要傳遞給動作的「友善」 –