Updating cakephp

Since always I try to play nicely with Cake PHP, I followed the the directions and used the console to generate the template and Po Edit to generate a file from this template, and then ……., nothing worked After digging into the framework source code, I found some details that’s not mentioned in the online tutorial by Cake PHP.

files aren’t the only source of getting localized strings, another type of files; files, is also used for this task.

I’m sure there are many ways of doing this, but recently I finally got round to figuring out how to update multiple records at a time.

When I started out all I wanted was to give all the selected records the same value for one database field, so the first thing we need to know is which records need to be updated and which field.

With a year under its belt and 34 releases, we are still in love with Cake PHP 3; and some of you are already on board and loving it.In order to use the sortable feature, you will need to edit the default layout.If you don’t already have your own layout you can copy the Cake PHP default one (which is used if your own one isn’t found) from The index is the order of elements after they have been sorted and the value is the id of each element.The important bits are, $form-array(‘Publish’,’Front Page’,’Featured’,’Delete’))) which creates the selectbox of actions.

To make use of this data, a new function is needed in the controller. The first thing your new function needs to do is create an array of ids that were checked, because cakephp will add a hidden field for every check box (see the cook book for details) we need every id that has a value of “1”. To make use of this array I use a switch statement to cycle through each of the actions and use either update All or delete All.I added the default action at the end in case anything goes wrong or if someone tries doing something they shouldn’t be.



  1. Pingback:

  2. eric   •  

    Try the halal, fun, and free muzmatch app that helps you find United Arab Emirates Muslim Dating Site.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>