Archive for the ‘ PHP ’ Category
Cake’s default way of handling simple static content is to use the built-in PagesController to serve up .tpl files from /app/views/pages. This is a simple and straightforward approach and works for very small websites, but comes with some obvious drawbacks: Making changes to the content of the pages requires editing template files; There’s no easy way (generally) [ READ MORE ]
At the request of an Ozzu member last night, I wrote up two new quick tutorials outlining how to write functions that can accept a variable-length argument list at run-time. I wrote the original tutorial for C programmers and later adapted it for PHP. I’ll likely adapt it for a few other languages in the [ READ MORE ]
Here’s a quick calendar element I whipped up for a CakePHP application I’m writing. I needed to use the calendar in a number of different places, so creating a view element for it in Cake made the most sense. <<< March 2009 >>> Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Download the source (zipped .ctp file) here: The code is pretty simple. Pass the [ READ MORE ]