Skip to content
klederson edited this page Nov 26, 2010 · 2 revisions

Spices Module

SPICES is something like an apt-get or a gems ( rails ).

Now in PhpBURN you can use third part SPICES using Spices Module

Compatibility

REQUIRE b1.0.2 or major

Just like another module you can choose to use spices by its own or in combination with other modules ( Model, Views, Controller ).

To add Spices in applications genereted by a PhpBURN older than b1.0.2 you should do this:

Download PhpBURN version b1.0.2 or major

Go to PhpBURN Official Repository for more informations.

Change your APPLICATION files

system/config/spices.php

	<?php
	namespace PhpBURN\Spices;
	################################
	# Spices Configuration
	################################
	\PhpBURN::load('Spices');
	Spices::loadSpice();
	?>

create a new directory

system/config/spices/

Change sysConfig.php by adding this:

    <?php
    define('SYS_SPICES_PATH', SYS_APPLICATION_PATH . DS . 'config' . DS . 'spices' . DS);
    define('SYS_SPICES_EXT','spices.php',true);

Change config.php by adding this:

    <?php
    # Spices
    PhpBURN::loadModule('Spices');

Usage

Install a New Spice

WORKING ON IT

Use a Spice

You simply add your spice configuration file into system/config/spices/

Example for rawtest spice:

	system/config/spices/rawtest.spices.php

With it's configuration content

    <?php
	PhpBURN_ControllerConfig::addOnCallActionBefore(
	        'phpburn_spice_rawtest',
	
	        function($action, $parms) {
	            var_dump($action, $parms)
	        }
	);

And then check it out, open your controller and see what you get on screen