mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 09:14:08 +02:00
Action controller example function: Config()
This commit is contained in:
parent
aa821d9cd4
commit
69538270f7
@ -59,6 +59,32 @@ class ActionController extends Zend_Controller_Action
|
|||||||
*/
|
*/
|
||||||
protected $requiresAuthentication = true;
|
protected $requiresAuthentication = true;
|
||||||
|
|
||||||
|
private $config;
|
||||||
|
|
||||||
|
private $configs = array();
|
||||||
|
|
||||||
|
// TODO: This would look better if we had a ModuleActionController
|
||||||
|
public function Config($file = null)
|
||||||
|
{
|
||||||
|
if ($this->config === null) {
|
||||||
|
$module = $this->getRequest()->getModuleName();
|
||||||
|
if ($module === 'default') {
|
||||||
|
if ($file === null) {
|
||||||
|
$this->config = Config::app();
|
||||||
|
} else {
|
||||||
|
$this->config = Config::app($file);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($file === null) {
|
||||||
|
$this->config = Config::module($module);
|
||||||
|
} else {
|
||||||
|
$this->config = Config::module($module, $file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->config;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The constructor starts benchmarking, loads the configuration and sets
|
* The constructor starts benchmarking, loads the configuration and sets
|
||||||
* other useful controller properties
|
* other useful controller properties
|
||||||
|
Loading…
x
Reference in New Issue
Block a user