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 [...]
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 [...]
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.
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 [...]
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 [...]
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…
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 [...]