chathura86/zf2-application-variable

Zend Framework 2 module providing application level variables

dev-master 2014-04-22 18:55 UTC

This package is not auto-updated.

Last update: 2025-03-10 17:36:50 UTC


README

Application level variables for Zend 2

(This is a customized version and not yet suitable for general use. I'll update this once it is suitable for general use. How ever feel free to use it if you know what you are doing.)

Requirements

Installation

  1. On your composer.json add:
{
    "require": {
        "chathura86/zf2-application-variable": "dev-master"
    }
}
  1. Run php composer.phar install
  2. Open configs/application.config.php and add 'AppVariableBundle' to your 'modules' parameter.

How to setup

<?php
// configs/autoload/local.php
return array(
	// other configurations
    'AppVariableBundle' => array(
        'driver' => 'memory',			// available drivers memory|file
		'path' => sys_get_temp_dir()	// requred only for file based driver
    )
);
?>

How to use

// in controller
$this->getServiceLocator()->get('AppVariable') // VariableManager object