Using Zend_Config INI or XML with dynamic data

evgcc

New Member
I have such an array for rendering TableGear:\[code\]array( "database" => array( 'username' => $this->config->resources->db->params->username, 'password' => $this->config->resources->db->params->password, 'name' => $this->config->resources->db->params->dbname, 'table' => "projetos", 'fields' => array( 'pro_cliente', 'pro_area', 'pro_evento', 'estado', 'cidade', 'pro_mes', 'pro_montagem_inicio', 'pro_montagem_fim', 'pro_evento_inicio', 'pro_evento_fim', 'pro_desmontagem_inicio', 'pro_desmontagem_fim', 'pro_atendimento', 'pro_projeto', 'pro_situacao' ) //"noAutoQuery" => true ), "selects" => array( 'pro_situacao' => array('Aberto', 'Em Andamento', 'Fechado', 'Cancelado'), 'estado' => $this->estados->getEstados() ), "formatting" => array( 'pro_valor' => 'currency[prefix=R$ ,pad]', 'pro_montagem_inicio' => 'date[d/m]', 'pro_montagem_fim' => 'date[d/m]', 'pro_evento_inicio' => 'date[d/m]', 'pro_evento_fim' => 'date[d/m]', 'pro_desmontagem_inicio' => 'date[d/m]', 'pro_desmontagem_fim' => 'date[d/m]' ), 'headers' => array( 'pro_id' => 'ID', 'pro_cliente' => 'Cliente', 'pro_area' => 'Area', 'pro_evento' => 'Evento', 'estado' => 'UF', 'cidade' => 'Cidade', 'pro_mes' => 'Mes', 'pro_montagem_inicio' => 'Inicio Montagem', 'pro_montagem_fim' => 'Fim Montagem', 'pro_evento_inicio' => 'Inicio Evento', 'pro_evento_fim' => 'Fim Evento', 'pro_desmontagem_inicio' => 'Inicio Desmontagem', 'pro_desmontagem_fim' => 'Fim Desmontagem', 'pro_atendimento' => 'Atendimento', 'pro_projeto' => 'Projeto', 'pro_situacao' => 'Situacao', 'pro_valor' => 'Valor', 'DELETE' => 'Deletar' ), 'columns' => array( 'pro_montagem_inicio' => 'date-picker', 'pro_montagem_fim' => 'date-picker', 'pro_evento_inicio' => 'date-picker', 'pro_evento_fim' => 'date-picker', 'pro_desmontagem_inicio' => 'date-picker', 'pro_desmontagem_fim' => 'date-picker' ), 'allowDelete' => false, 'editable' => 'none' ); // End of Tablegear\[/code\]As you can see. I use dynamic data \[code\]$this->config->resources->db->params->username\[/code\] and \[code\]$this->estados->getEstados()\[/code\] (data from my database) which I can only get inside the controller in an array-form data.I found these options too large and unnecessary to be in the controller. I'd like to use Zend_Config with a INI or XML file. But how can I retrieve these data I use (i.e. \[code\]$this->estados->getEstados()\[/code\])?
 
Back
Top