Recipe loader

We will create a way to load recipes trough especific markup from a page. Each recipe will be a key inside an array, each recipe can have dependencies on other recipes that will be loaded as well.


It is just a simple array containing all the recipes that can be loaded trough markup, and also dependencies for each recipe, like this:

SDVA($RecipeLoader, array(
  'youtubevideos' => array('available' => 'yes','dependencies'=> 'flash2,urlget'),
  'Dcal' => array('available' => 'no','dependencies' => 'Dcalentry, Dcaljs')

After configuring the array with availabilitty and dependencies, we create sections inside config.php to acomodate each recipe, with options and an include_once() call, like this:

    $youtubevideos['mykey'] = 'iur498uf49u4'

So you can arrange the recipes in a proper order before using the markup.

The RecipeLoader array will be processed, dependencies will be placed inside the LoadRecipe as well and recipes will be loded in a orderly fashion each time they are requested.


The recipes will be loaded after we process he template of a skin.

We will load $pagename and all other pages requested inside skin template.

After that we search for a specific directive called (:loadrecipe recipe1,recipe2:) or perhaps just (:load recipe1, recipe2:) than if the recipes is loadable and is available (recipe could be in maintenance), it will be loaded and ready to use when the load markup is processed.

When a recipe is in maintenace mode a message will be sent to $MessagesFmt .

All the pages requested by template and $pagename will be loaded twice, in exchange if you use lots of recipes, those recipes will only be loaded when explicitly requested by the directive.

For an example, if you have 10 recipes to deal with different embeded media, but you are using just one recipe in one page, all other 9 recipes will not be loaded for that page.