Billy ONeal
Billy ONeal

Reputation: 106609

Is it possible to read a Zend_Application configuration variable inside of a controller?

I'd like to have something like a

webmasterEmail = [email protected]

where the ErrorController sends an email if the application is running in production mode. Is it possible to just tack this on to Zend_Application's .ini file and retrieve the values in a controller later?

Upvotes: 1

Views: 118

Answers (1)

Phil
Phil

Reputation: 165058

All too easy :)

// return all options as an array
$options = $this->getInvokeArg('bootstrap')->getOptions();

// or, specifically
$webmasterEmail = $this->getInvokeArg('bootstrap')
                       ->getOption('webmasterEmail');

Upvotes: 5

Related Questions