Posts Tagged ‘ cake ’
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 ]
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 ]
My assumption going into this was that creating a tree-like relationship within one of my models would be fairly straightforward with Cake’s model relationships. As it turns out, I was absolutely correct. Let’s say we want to create a model called “Category”, and each category can belong to a parent category. In other words, we want [ READ MORE ]