Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML style input with Cakephp Action
    primarykey
    data
    text
    <p>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.</p> <p>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.</p> <p>I am a total noob at cakephp so any help would be great.</p> <p>Here is the code for the buttons using the form:</p> <pre><code>&lt;td&gt;&lt;input type="button" id="viewButton" value="View"/&gt;&lt;input type="button" id="editButton" value="Edit"/&gt;&lt;input type="button" id="deleteButton" value="Delete"/&gt;&lt;/td&gt; </code></pre> <p>(I don't have any events on the button becase I don't know how to link the events to the controller)</p> <p>Here is the same thing but written with cakephp's form helper:</p> <pre><code>&lt;td&gt;&lt;?php echo $this-&gt;Form-&gt;button('View', array('type' =&gt; 'button', 'action' =&gt; 'view'), $LocalClock['LocalClock']['id']); echo $this-&gt;Form-&gt;button('Edit', array('type' =&gt; 'button', 'action' =&gt; 'edit', $LocalClock['LocalClock']['id'])); echo $this-&gt;Form-&gt;button('Delete', array('type' =&gt; 'button', 'action' =&gt; 'delete', $LocalClock['LocalClock']['id']));?&gt; &lt;/td&gt; </code></pre> <p>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.</p> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload