Cakephp console error cake: line 30: exec: php: not found
If you getting the cakephp console error "./cake/console/cake: line 30: exec: php: not found" its a fairly simple fix to get things going again...
Croogo - Fatal error Cannot access empty property in configure.php
Just a quick note, I was playing around with a plugin in Croogo which required me to deactivate and then activate the component to get some new entries added to the settings and Aco actions added. In doing so I changed the code to add and remove the new variables in the settings and then deactivated the plugin. I didn't track down the sequence exactly but...
Cakephp - Parse error: syntax error, unexpected T_STRING
I was just trying out a Cakephp 1.3.x install with a vanilla Croogo CRM installation and got the following parse error when installing onto my MediaTemple hosting...
Shhhh! Keep quiet cakephp console
Its been a while since I've had a chance and/or motivation to write any notes down, in the words of Willie Wonka "So much time, so little to do....ahhhh, strike that, reverse it..."
At any rate this note is in relation to the cakePHP console and keeping it quiet. Sometimes you need the verbose / debug information and other times it makes it impossible to work in the same shell window...
Displaying your cakephp 1.2 version
The CakePHP dev's have made it super simple to display your cakephp version, I have only just stumbled across it when looking for something else in the API. Like me you might not have spotted it, its not an essential bit of code but a nice to have for those administering many sites on various servers and much better than finding the version text file on each install. I display the version number in the system setup part of the sites admin dashboard along with other framework related settings...
Custom group by pagination and a calculated field
This is a basic example of how to use the CakePHP paginator helper with the group by condition, it took a little mucking around but this is how I got it working.
In this example we have a Comment controller which I want to paginate a custom query displaying an IP address and a calculated count field of the number of spam comments from this particular IP address...
Geshi code to plain text JQuery javascript toggle
I was about to update my somewhat limited Geshi helper to handle more code types and to sort out the added character errors when pasting a copied code block when I stumbled upon Mark Story's Geshi Helper and took a look.
Marks code was super simple to use, the only real coding I did was to convert Marks MooTools javascript text toggle to JQuery...
SEO meta tags under Cakephp 1.2
How to set you meta tag keywords and descriptions under cakephp with the $html->meta() helper function...
Basic search engine optimisation (SEO) under CakePHP 1.2
The following article outlines some simple methods that can be used for improving search engine optimisation under the CakePHP 1.2 framework...
Setting meta tag descriptions and keywords under CakePHP 1.2
The following article outlines a very simple method for setting meta tag descriptions and keywords in your views, these are optionally used by search engines...
CakePHP bookmarks
A list of the useful CakePHP web sites and related information that I have come across. These links will be updated as time permits...
RSS made easy with CakePHP 1.2
Feed me seymour! RSS feeds are made a breeze with CakePHP 1.2, three simple steps and it should be up and running...
Sitemaps made easy with CakePHP 1.2
Sitemaps are an essential aspect of most websites whether its just for SEO or simply to assist with the user site navigation. CakePHP 1.2 makes sitemaps a breeze to create and what makes its even better is that CakePHP can generate portions of your sitemp automatically...
Not getting setFlash messages in CakePHP 1.2
If your not observing your $this->Session->setFlash messages, make sure you have the following code present in your layout or view...
Model field warning 512 try implementing a schema in CakePHP 1.2
While trying to implement a contact form with no table set (i.e. $useTable=false) I came across the following 512 warning "Unable to use model field data ... try implementing schema()" ...
Customizing your form labels in CakePHP 1.2
If you want to customize the labels placed on forms you can assign an array to the label parameter in the $form helpers options, for example...
HABTM error 512 duplicate sql in CakePHP 1.2
While trying to submit a $hasAndBelongsToMany (HABTM) related form under cakephp (1.2 rev 6311) I was getting the following SQL Error :-
Warning (512): SQL Error: 1062: Duplicate entry '4-1' for key 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 440]
Validates function deprecated warning 512 in CakePHP 1.2
While trying to implement a simple authorization login using the cakephp (1.2 rev 6311) AuthComponent I struck the following warning for the controller $this->Model->validates($data) function call ...