mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
ModuleActionController: module object shortcut
This helps modules with the need to know more about themselves. No more App -> Module Manager -> Module voodoo.
This commit is contained in:
parent
3576263559
commit
3f9f4bb9e1
@ -3,6 +3,7 @@
|
|||||||
namespace Icinga\Web\Controller;
|
namespace Icinga\Web\Controller;
|
||||||
|
|
||||||
use Icinga\Application\Config;
|
use Icinga\Application\Config;
|
||||||
|
use Icinga\Application\Icinga;
|
||||||
use Zend_Controller_Request_Abstract as Request;
|
use Zend_Controller_Request_Abstract as Request;
|
||||||
use Zend_Controller_Response_Abstract as Response;
|
use Zend_Controller_Response_Abstract as Response;
|
||||||
|
|
||||||
@ -12,6 +13,8 @@ class ModuleActionController extends ActionController
|
|||||||
|
|
||||||
private $configs = array();
|
private $configs = array();
|
||||||
|
|
||||||
|
private $module;
|
||||||
|
|
||||||
protected $moduleName;
|
protected $moduleName;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
@ -44,6 +47,14 @@ class ModuleActionController extends ActionController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function Module()
|
||||||
|
{
|
||||||
|
if ($this->module === null) {
|
||||||
|
$this->module = Icinga::app()->getModuleManager()->getModule($this->moduleName);
|
||||||
|
}
|
||||||
|
return $this->module;
|
||||||
|
}
|
||||||
|
|
||||||
public function postDispatch()
|
public function postDispatch()
|
||||||
{
|
{
|
||||||
$req = $this->getRequest();
|
$req = $this->getRequest();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user