Saving data with Model->saveAll() is really time savior. There is something specifics while saving multiple records of a single model.
The data provided from the form should be in the numerically indexed array of records like this:
Article] => Array(
 => Array
 => Array
Your code for saving this data with saveAll() should look like this:
Ok, but if you pass only
it won’t work. So if you want to save multiple records of a single model provide the proper data. It took me 1/2 hour to detect that this is the problem.
Of course this is written in the CookBook, but somebody need to read it carefully 😉
Probably everybody know how to match dom elements with css. For example if you want to match all <li> elements. you are doing something like this:
This way every list element will have red text color.
The more advanced example is if you want to select only the active element – an element with a specific class. This way you are adding a style like:
This way only the active elements (list elements with class active) will have red text color.
Ok, but what if we want to match elements which has 2 specific classes?
Let’s say you have following structure:
How to make the first list element to be with red color?
The obvious solution is to add an extra class like this:
but what if there is an easiest solution?
<li class="first second"
As you may notice the css selector which is used is .first.second, so no spaces between them.
This way you can assure that only the element which has class first and second will meet the criteria and will be colorized in red. This notation works with ID’s as well, but basically if you have ID, then you know what is the exact element, so it’s useless, but for selection of two classes I think it really useful.
I would like to know if somebody knew about this way of selecting elements?
I am using it for a while, but today I’ve decided to publish in the github.com.
What this plugin does?
The plugin is complete solution to add menu in your applications. It uses the nifty Superfish – jQuery menu plugin. You can find more info for it at http://users.tpg.com.au/j_birch/plugins/superfish/
Cakemenu can work with multilevel menus and reduces the database calls by caching the menu nodes. The plugin working with Authake plugin if you need to apply filter to menu nodes (user need to see only allowed locations)
Cakemenu working with CakePHP 1.2 but it’s tested with Cakephp 1.3 (RC3) and it would not have any problems with the future releases so far.
- CakePHP 1.3 (of course)
- jQuery in the head tag
- Authake (optional) if you require your menu nodes to be filtered when user with limited privileges is logged in. Actually it’s possible to use other authorization class, but you have to extend it.
I believe that’s it. Check the large README file in the project’s directory.