【发布时间】:2011-09-20 02:28:59
【问题描述】:
这是一个 =>
echo $this->Html->link('Edit',
array('controller'=>'comments','action'=>'edit',$comment['Comment']['id']));
这是另一种形式 =>
echo $this->Form->create('Comment',
array('url'=>array('controller' => 'comments', 'action' =>'add', $listposts['Post']['id']) )
);
echo $this->Form->input('post_id',array('type'=>'hidden','style'=>'width:30%','value'=>$listposts['Post']['id']));
echo $this->Form->input('name',array('style'=>'width:30%'));
echo $this->Form->input('email',array('style'=>'width:30%'));
echo $this->Form->input('body',array('rows'=>'5'));
echo $this->Form->end('Submit');
是否可以像上一个一样 echo $this->Form->create ?为什么我需要'url'=>array(..) 为什么不喜欢这个=>
echo $this->Form->create('Comment',array('controller' => 'comments', 'action' =>'add', $listposts['Post']['id']));
【问题讨论】:
标签: php cakephp routing cakephp-1.3