My favorites | Sign in
Project Home Downloads Issues Source
Search
for
Dig_Core  
Updated Sep 30, 2009 by forrestlyman@gmail.com

The Dig_Core package is the base of Digitalus Framework, and should be the first thing that you install in your project. It registers the Dig library with the application and adds the core classes.

About Dig_Core

The Dig_Core class serves as a broker for all of the CMS framework resources. At its simplest it is a registry of sorts:

// set a parameter
Dig_Core::setParam('test', 'value');

// get the parameter
$value = Dig_Core::getParam('test');

It supports two magic methods, get and set:

// set a value
$digCore->setTestValue('value');

// fetch it using the static method
$value = Dig_Core::getParam('test_value');

// or the magic method
$value = $digCore->getTestValue();

These methods can create a very dynamic core that is easy for you to customize without touching the library. For example, you can store objects in the core (as the system does in many cases), and then access them using the fluent interface:

// set the navigation property
$navigation = new Dig_Navigation($node);
Dig_Core::setParam('navigation', $navigation);

// then you can use it throughout the application
$navigationObject = Dig_Core::getInstance()->getNavagation();

Sign in to add a comment
Powered by Google Project Hosting