Wow, I haven’t posted anything on my blog for a while. I guess I must be busy. A new baby will have that effect. Anyway, I’m happy to release an update to my Copyable behavior, which I shared with everyone a few months ago. Download the new version on the Github repository. Along with some [...]
Here’s a quickie – a Cipher behavior for CakePHP to handle two-way encryption of sensitive data. If you want to store, say, credit card information, you’ll need a way to retrieve it later; Cake’s built-in security hashing is one-way, meaning that once it’s encrypted it ain’t comin’ back. So, I turned to the Zend Framework [...]
OK, so I’ve been working a lot with Cake’s Tree Behavior for the past six or seven months, because a lot of the plugins I’m building at work require complex category structure (i.e. more complex than simple parent -> child). Tree Behavior’s implementation of MPTT is good, but – unless I’m using the behavior incorrectly [...]
Just a quick update – I’m currently working on integrating some libraries from the Zend Framework into CakePHP. The first one I’m doing is Zend_Validate, which is a heavy, robust alternative to CakePHP’s own Validation class. I’ll be sharing my results as a plugin when I’m done. Stay tuned.
The Validation::postal() method that comes with CakePHP 1.2 is good in that it can handle a number of different country formats, but the problem is you can only validate your data against one country. What if you want to accept, say, either Canadian or US postal/zip code formats? I ran into this problem earlier today, [...]
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 of every record in the table, use PHP to select [...]
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.
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 that plugin’s controllers. For example, we might have a products [...]
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 set by Cake and using it as a custom parameter [...]
I don’t know about you, but I’m tired of clients treating web developers like brainless code monkeys. After so many years as a part of a legitimate and growing industry, why are web developers not yet treated like experts? Why do clients demand the final say on the presentation and mechanics of a website? Web [...]