Archives for: November 2009
Finding Random Model Records in CakePHP 1.2

THIS CONTENT IS OUT OF DATE! IF YOU’RE USING CAKE 2, YOU SHOULDN’T READ THIS. There are two main methods for finding random records with PHP (and in this case CakePHP) and MySQL: Use a SELECT query with ORDER BY RAND() and LIMIT x (where x is the number of results you want). Get a list of the primary keys [...]

By Jamie with 4 comments
Adding Automatic Query Caching to Model::find() in CakePHP 1.2

THIS CONTENT IS OUT OF DATE! IF YOU’RE USING CAKE 2, YOU SHOULDN’T READ THIS. If you use CakePHP’s caching system but don’t like having to wrap you calls to Model::find() in if statements (“if cache result found… else…”) then this little quick tip is for you. Basically, we’re just going to put a slightly modified version of Model::find() in [...]

By Jamie with 5 comments
The Code Stylings of Jamie Nay: Now Featuring GitHub!

Yup, I’ve finally joined the party and created a GitHub account for myself. There’s not much on there – currently just one bit of code, a CakePHP component. I’m hopefully going to fill out the repository with a bunch of uself stuff soon.

By Jamie with 0 comments
An Easy Plugin Callback Component for CakePHP 1.2

THIS CONTENT IS OUT OF DATE! IF YOU’RE USING CAKE 2, YOU SHOULDN’T READ THIS. Most people who do serious, large scale development with CakePHP would agree that keeping the bulk of a project’s code segregated in plugins is the best way to keep things organized. Sometimes, however, we want to use a plugin’s functionality outside of the scope of [...]

By Jamie with 4 comments
Useful CakePHP Tutorial Roundup for November 20, 2009

Wow! It’s been a while since I’ve written much about CakePHP, PHP, or just anything useful in general. I guess I’ve been pretty busy. Hectic job, baby on the way, that sort of thing. But I’m trying to get back into blogging because it’s a good outlet for my desire to write, plus I love to share useful code with [...]

By Jamie with 1 comment
The Great Theme Search Continues

I’m officially fed up with my latest WordPress theme. So, I’m going to try out a couple to try to find the best fit. Yes, I’m a web developer and yes, I should come up with my own, but…

By Jamie with 0 comments
‘form’ a reserved word for CakePHP 1.2 controller params – watch out!

THIS CONTENT IS OUT OF DATE! IF YOU’RE USING CAKE 2, YOU SHOULDN’T READ THIS. Just a quick bit of advice to those who may have been banging their heads against the walls when trying to pass “form” as a custom parameter in a CakePHP URL. Apparently ‘form’ is a param – an array, to be specific – that’s already [...]

By Jamie with 0 comments