20111007

Zend Framework: How to access your configuration from the application.ini file

There are many ways of getting the config from our application.ini file. The usual way is to load it using Zend_Config in our Boostrap class. The other way is to load it from a parameter in the front controller (Zend_Application put it there).

Using Bootstrap
Add this to your Boostra.php file:


You can fetch the config wherever you want using: 
$config = Zend_Registry::get("config");
Loading from Front controller
From a View action:

From outside the controller:

No hay comentarios.:

Publicar un comentario