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
内关闭它?
答案 0 :(得分:2)
定义您想要提交表单的路线
echo $this->Form->create('Cost', array(
'url' => array('prefix'=>null, 'controller' => 'costs', 'action' => 'add')
));
PS:像任何其他路径数组一样更改url数组以满足您的需求。
参考:docs