Category Filter - (Cakephp)

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...

Filed under: Cakephp  Tags: Error

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...

Filed under: Cakephp  Tags: Error

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...

Filed under: Cakephp, Hosting  Tags: Mediatemple, Croogo

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...

Filed under: Cakephp  Tags: Shell

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...

Filed under: Cakephp  

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...

Filed under: Cakephp  Tags: Pagination

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...

Filed under: Cakephp, Javascript  Tags: 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...

Filed under: Cakephp  Tags: Seo

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...

Filed under: Cakephp  Tags: Seo

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...

Filed under: Cakephp  Tags: Seo

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...

Filed under: Bookmarks, Cakephp  

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...

Filed under: Cakephp  Tags: Rss

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...

Filed under: Cakephp  Tags: Sitemap, Seo

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...

Filed under: Cakephp  Tags: Setflash

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()" ...

Filed under: Cakephp  

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...

Filed under: Cakephp  Tags: Form

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]

Filed under: Cakephp  Tags: Habtm

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 ...

Filed under: Cakephp  Tags: Validation
(default) 9 queries took 21 ms
NrQueryErrorAffectedNum. rowsTook (ms)
1DESCRIBE `posts`17171
2DESCRIBE `comments`111111
3DESCRIBE `tags`221
4DESCRIBE `categories`221
5DESCRIBE `posts_tags`221
6DESCRIBE `categories_posts`221
7SELECT Post.* FROM posts Post, categories_posts pc, categories c WHERE c.category = ('Cakephp') AND c.id = pc.category_id AND pc.post_id = Post.id AND Post.status = 1 ORDER BY Post.created DESC18183
8SELECT category, COUNT(*) AS cat_cnt FROM categories_posts c2p INNER JOIN categories Cat ON c2p.category_id = Cat.id GROUP BY category15151
9SELECT tag, COUNT(*) AS tag_cnt FROM posts_tags t2p INNER JOIN tags Tag ON t2p.tag_id = Tag.id GROUP BY tag49491