Useful CakePHP Tutorial Roundup for November 20, 2009
20
Nov
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 others.
I kept up this useful tutorial roundup for a little while and then dropped off the face of the earth… oops. So, let’s try this again – the Friday tutorial roundup. Even though I haven’t been blogging about it, I’m constantly coming across useful CakePHP tips, code, and tutorials that save me a lot of time. So I thought it might be useful to others to gather up some tutorials every Friday and just get them out there. Some are new; some are old chestnuts.
Here’s what I’m finding useful these days:
- Searchable Plugin – Neil Crookes (Fall 2009)
I came across Neil’s new site search plugin by chance while planning for my own site search plugin for our in-house CakePHP CMS at work. I was impressed with the clean code, and especially the shell to rebuild the search index. Woefully few CakePHP developers take advantage of shells. Neil has utilized this oft-forgotten feature of Cake very well. The documentation for the plugin is pretty spare (as Neil himself will admit), but there are enough inline comments in the code to figure out how the system works, and the SQL schema is included as well.
- Expandable Behavior – Felix Geisendörfer, Debuggable (June 01, 2008)
Now here’s one from Felix that I started to use almost immediately after discovering it. While developing my CMS, I needed the ability to define an indefinite and unlimited number of fields for models. I was originally going to go all out and implement the EAV database design model, but after a lot of research determined that forcing Cake into that schema might just contort it a little too much. EAV, in other words, isn’t really a “Cakey” way of doing things since it can’t take advantage of a lot of Cake’s built-in model functions (at least not without a lot of extra work). So, in comes Felix’s expandable behavior, which allows you to define new fields at will and save them to a separate table. While the behavior’s not perfect – you’ll have to write your own validation and field limitations (I made it into an online tool in my CMS) – it’s a great starting point.
- Drag and drop using Ext JS with the CakePHP Tree Behavior – Adam Royle (February 02, 2008)
If you work with Cake’s Tree behavior and you want a slick interface for representing and reordering your trees, then Adam’s usage of Ext JS is for you. I write a lot of Javascript at work but it’s not my strong point, so when it came time to do an AJAX-enabled tree interface, I went out into the great interwebs for some help. I was originally looking for a JQuery solution, but Adam’s was so hard to resist since he wrote the tutorial specifically for CakePHP. It’s a great starting point and easy to expand upon.
- HttpSocket Instead of cURL in CakePHP Apps - Matt Curry (February 16, 2009)
Matt draws attention to an under-used CakePHP library, HttpSocket, in this little quickie. For those who prefer their code wrapped in classes, HttpSocket is a great alternative to cURL for opening remote connections. And, as Matt says in his example, “nine cURL lines become for lines of Cake code”. Think of HttpSocket as a more “Cakey” way to open remote URIs.
2 Responses to Useful CakePHP Tutorial Roundup for November 20, 2009
Neil Crookes
November 21st, 2009 at 2:01 am
Saw you’d mentioned the searchable plugin, so thought I’d better write some instructions/documentation for it…
http://www.neilcrookes.com/2009/11/21/cakephp-searchable-plugin/
Tweets that mention Jamie Nay » Blog Archive » Useful CakePHP Tutorial Roundup for November 20, 2009 - A PHP web developer writing about the web. -- Topsy.com
November 21st, 2009 at 2:03 am
[...] This post was mentioned on Twitter by Planet CakePHP, ichikaway. ichikaway said: RT @literaphile: New blog post: Useful CakePHP Tutorial Roundup for November 20, 2009 – http://jamienay.com/ny [...]