When I say document containers, what I'm really talking about is all those arrays in the document model that store things like metas, scripts, css, etc.
About a year ago, I was working on a project using another framework. Being used to Joomla's document object, I wanted something that would mimick that. It needed all the typical containers - document type, language, title, css, scripts, etc. But what I also wanted was a way to prepend an item to a container. I tried various array handling techniques and somewhere along the way stumbled upon the ArrayObject. It wasn't so much the ArrayObject that caught my attention as it was what was missing - appending an item to the object. Fortunately, I found an example of how to do that. What I wound up with was a model where the containers were ArrayObjects instead of simple arrays. Plus, as objects, I can chain methods like this"
Code: Select all
$thisContainer->add('something')->add('somethingelse')
Code: Select all
$thisContainer->prepend('something');
Code: Select all
$document->appendTitle(' : page 2');
Code: Select all
$document->prependTitle('Company : ');
So what does all this have to do with Joomla? First, I'd really like to see the ability to prepend items to some of the standard containers like scripts and css. I'd also like to see a container we can use just before the body close tag. Of course, method chaining is also a really nice feature.
Using a technique like this, we gain a lot of flexibility. Especially when it comes to extensions and how they interact with the document model and in particular how we render the head tag.
So, here's a link to the document container I used on that project: https://github.com/alwarren/codeigniter-document_model
Have a look, dig around, think about whether any of that stuff might work for Joomla. It was just an idea at the time and wound up hugely beneficial to my project.