On 1 Jun 2009, at 18:51, Matthew Weier O'Phinney wrote:
-- dmitrybelyakov <dmitrybelya...@yandex.ru> wrote
(on Monday, 01 June 2009, 10:18 AM -0700):
vince. wrote:
Another way will be storing the config in the registry then you
could
access
it anywhere.
Yes sure. I expected it to be there since it's already passed to
Zend_Application but it's not. Just don't want to include the same
file for
the second time.
But seems like it's the only way since the Options you get from
Bootstrapper
(like in examples above) aren't a Zend_Config object (it's set
toArray by
Zend_Application). I now try to figure out a way to populate
Zend_Config
object with an array. If it's not possible - will include the file
again.
You can, and it's easy:
$config = new Zend_Config($array);
--
Matthew Weier O'Phinney
Project Lead | matt...@zend.com
Zend Framework | http://framework.zend.com/
You can create an _initConfig() method in your Bootstrap class that
looks like this:
protected function _initConfig()
{
$config = new Zend_Config($this->getOptions());
Zend_Registry::set('config', $config);
}
Regards
Rob...