2011-05-26 87 views
1

HI, IM使用url如何设置cakephp编辑表单自定义网址?

/controller/action/group_id/id 

访问我的edit_view但是当我检查我的诉讼中,仅使用

/controller/action/id 

使用下面的我已经尝试过。

$params = array('url' => array('controller' => 'controller','action'=> 'action',$group_id,$id)) 
$this->form(model,$params) 

$params = array('url' => '/controller/action/group_id/id') 
$this->form(model,$params) 

但它仍然无法正常工作。

感谢

回答

6

真的不知道什么是$this->form(),但尝试:

echo $this->Form->create('SomeModel', array(
    'url' => array(
    'controller' => 'controller', 
    'action' => 'action', 
    $param_1, 
    $param_2 
    ) 
)); 
+0

我想说的是,有CakePHP中没有'$这个 - > form'。你使用什么版本? – PawelMysior 2011-05-27 01:37:59