HTML style input with Cakephp Action

In my index.ctp, I am creating a table and the last column of the table will have 3 buttons to perform actions on that specific row. The buttons will be View, Edit, and Delete. I am trying to decide what will be easier, using cakephp's form helper to create a button and link the button with the corressponding controller action, or use javascript to create the input but then how would I link the onclick to the controller action. I am a total noob at cakephp so any help would be great. Here is the code for the buttons using the form: (I don't have any events on the button becase I don't know how to link the events to the controller) Here is the same thing but written with cakephp's form helper: Form->button('View', array('type' => 'button', 'action' => 'view'), $LocalClock['LocalClock']['id']); echo $this->Form->button('Edit', array('type' => 'button', 'action' => 'edit', $LocalClock['LocalClock']['id'])); echo $this->Form->button('Delete', array('type' => 'button', 'action' => 'delete', $LocalClock['LocalClock']['id']));?> I needed help with getting the buttons to communicate with their actions. Ultimately I will try and open a modal window with one of the views in the window. Thanks in advance

以上就是HTML style input with Cakephp Action的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准