In an effort to keep my code DRY I would like to be able to define \"cross controller\" variables.
Classic example is that I would like access to some config items t
The following is my setup.
[PHP] 5.4.1
[phalcon] 1.2.1
Here is an excerpt from my bootstrap.(/app-root/public/index.php)
$di = new \Phalcon\DI\FactoryDefault();
// I'll pass the config to a controller.
$di->set('config', $config);
$application = new \Phalcon\Mvc\Application();
$application->setDI($di);
echo $application->handle()->getContent();
And this is an excerpt from my base controller.(/app-root/app/controllers/ControllerBase.php)
class ControllerBase extends Phalcon\Mvc\Controller
{
protected $config;
protected function initialize()
{
$this->config = $this->di->get('config');
$appName = $this->config->application->appName;