Ver Mensaje Individual
  #4 (permalink)  
Antiguo 21/07/2009, 19:10
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Zend Framework 1.8 - ¿cómo capturar valores del ini file?

Yo lo que hago es algo así en el Bootstrap:
Código php:
Ver original
  1. protected function _initConfiguration() {
  2.         $config = new Zend_Config_Ini(  
  3.             APPLICATION_PATH . '/configs/config.ini',
  4.             APPLICATION_ENV
  5.         );
  6.          
  7.         return $config;  
  8.     }

Luego en el Controller hago algo así:
Código php:
Ver original
  1. $bootstrap = $this->getInvokeArg('bootstrap');
  2. $config = $bootstrap->getResource('configuration')->toArray();
  3. var_dump($config);

Saludos.