echo $this->form->create('Cost', array('action' => 'add'));
echo $this->form->inputs(array(
'legend' => false,
'cost_type_id' => array(
'class' => 'span-8',
'options' => $cost_types
)
));
echo $this->html->tag(
'div',
$this->form->button(
sprintf('%s %s',
$this->html->image('icons/silk/application_add.png'),
__('Create new Cost', true)
),
array(
'title' => sprintf('Add')
)
),
array('class' => 'buttons clearfix')
);
echo $this->form->end();我有一个路由前缀集,它会自动将此表单发送到
/prefix/costs/add有没有一种方法可以在form->create或form->button中关闭它
发布于 2013-06-12 02:01:02
定义提交表单的路径,如下所示
echo $this->Form->create('Cost', array(
'url' => array('prefix'=>null, 'controller' => 'costs', 'action' => 'add')
));PS:像任何其他路由数组一样更改url数组以满足您的需要。
参考:docs
https://stackoverflow.com/questions/17049901
复制相似问题