You're querying from templates? Isn't that considered bad practise? Isn't there a potential problem with template designers querying for loads of data and issuing a slow query?
# controllers/BlogController.php
class BlogController extends AppController
{
function index ()
{
$this->entries = get("/channels/blogs/entries");
}
}
# templates/blog/index.html
{foreach $entries as $blog}
...
{/foreach}
Or, as in my example, this... # templates/blog.html
{get $entries from "/channels/blogs/entries"}
{foreach $entries as $blog}
...
{/foreach}
I've written substantial apps both ways, and so far I have found that powerful templates are actually easier to write, read, and maintain, perhaps because the entire request flow happens in a single file.I doubt Wordpress would be used for anything other than simple blogs if it weren't for querying from templates.
Obviously there is the risk of theme developers loading tons of queries from a template but I think trying to prevent that would be premature optimization. The benefit of greater customizability outweighs the potential performance hit IMO.