[eluser]Yorick Peterse[/eluser]
[quote author="Phil Sturgeon" date="1248196992"]Yorick, I realised I was being a bit silly with my request earlier of adding widget areas into a page. Thats clearly not any use if we can call widgets directly.
Lets have two library functions:
$this->widget->area('some-widget-area');
Loads an entire widget area and stops developers needing to use that foreach loop every time.
$this->widget->run('some-widget', TRUE/FALSE);
Runs a widget with default behaviour being output the content directly to output class. If TRUE, return the output as a string.
Then, we have a winner! This has lovely clean syntax and will mean we can have pre-defined theme widget areas, and end users can plonk widgets directly into a new page they create through the WYSIWYG.
Sound good?[/quote]
Omg you muppet, that's how the library works (with the exception of the true/false part).
@ray
The only thing that's stored in a json file is a list of available areas and widget information (author, description, etc). The rest goes in a database (such as the actual widget content).
I'll post a working demo soon, but first I really, really need to continue cleaning my room.