chathura86 / zf2-application-variable
提供应用级变量的 Zend Framework 2 模块
dev-master
2014-04-22 18:55 UTC
Requires
- php: >=5.3.3
- zendframework/zendframework: 2.*
Requires (Dev)
- zendframework/zendframework: dev-master
This package is not auto-updated.
Last update: 2024-09-23 14:54:48 UTC
README
Zend 2 的应用级变量
(这是一个定制版本,目前还不适合通用。一旦适合通用,我会更新它。不过,如果你知道自己在做什么,可以自由使用它。)
需求
- Zend Framework 2 (https://github.com/zendframework/zf2). 在 Zend Framework 2.0.0beta4 上测试过。
- PHP 5.3 或更高版本
安装
- 在你的
composer.json
中添加
{ "require": { "chathura86/zf2-application-variable": "dev-master" } }
- 运行
php composer.phar install
- 打开
configs/application.config.php
并将'AppVariableBundle'
添加到你的'modules'
参数中。
如何设置
<?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 ) ); ?>
如何使用
// in controller $this->getServiceLocator()->get('AppVariable') // VariableManager object