This is a quick little method that lets you get some data from a CSV into a table.
It should work with very large CSV files as it only has to read one row at a time.
This is a quick little method that lets you get some data from a CSV into a table.
It should work with very large CSV files as it only has to read one row at a time.
In this quick snippet of code I will be setting the ID of a model based on other fields given. We want to save a note about each Post that is different for every Client, however we do not want to have to get the ID every time we save the data.
Usually the client will request for me to give them a way to edit simple settings in their application.
I decided to read all the variables from the database in the beforeFilter to make them available in any controller.
In almost every project I need to setup some sort of login, and usually it requires group access to certain data depending on different criteria.
For example I may have groups Admin+Member and I want Members to only be able to see other Users Profiles if the other Profile is active.
I had a play with the Tree Behaviour in CakePHP and was very impressed at what you could create with such ease.
This method of linking models allows you to have a single table of data, say Comment, that is related to any one of a number of other Models (eg: Post, Event).
I would like to document several speedy ways I have of working with HABTM data.
The code includes: HABTM Select, HABTM Checkbox, HABTM Text Add, HABTM TextArea Edit.
This CakePHP example will show you how to merge your Add and Edit forms into a Single Form action.
This may be of benefit if you have a form with complex controller logic that you don't want to duplicate.
This is a simple action to display a random record. Possibly useful for sites wanting to keep people clicking on something.
I wanted to make a quick and easy breadcrumb that worked with a simple array.
The breadcrumb is an array containing multiple links from html_helper::link().