本文整理汇总了PHP中Centreon\Internal\Di::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Di::get方法的具体用法?PHP Di::get怎么用?PHP Di::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Centreon\Internal\Di
的用法示例。
在下文中一共展示了Di::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetBadServiceType
public function testGetBadServiceType()
{
$di = new Di();
$di->set('badservice', array());
$this->setExpectedException('\\Centreon\\Internal\\Exception', "Bad type of service");
$di->get('badservice');
}
示例2: __construct
/**
* Constructor
*
* @param string $name The name of form
* @param array $options The options
*/
public function __construct($name, $options = null)
{
$this->formProcessor = new \HTML_QuickForm($name, 'post');
$this->formName = $name;
$this->options = $options;
$this->init();
$this->di = Di::getDefault();
$this->tpl = $this->di->get('template');
}
示例3: init
/**
* Initialize page
*
*/
protected function init()
{
$this->di = Di::getDefault();
/* Init template */
$this->tpl = $this->di->get('template');
/* Load CssFile */
$this->tpl->addCss('jquery.dataTables.min.css')->addCss('dataTables.tableTools.min.css')->addCss('dataTables.colVis.min.css')->addCss('dataTables.colReorder.min.css')->addCss('dataTables.bootstrap.css')->addCss('select2.css')->addCss('select2-bootstrap.css')->addCss('centreon-wizard.css');
/* Load JsFile */
$this->tpl->addJs('jquery.dataTables.min.js')->addJs('dataTables.tableTools.min.js')->addJs('dataTables.colVis.min.js')->addJs('dataTables.colReorder.min.js')->addJs('bootstrap-dataTables-paging.js')->addJs('jquery.dataTables.columnFilter.js')->addJs('dataTables.bootstrap.js')->addJs('jquery.select2/select2.min.js')->addJs('jquery.validation/jquery.validate.min.js')->addJs('jquery.validation/additional-methods.min.js')->addJs('centreon-wizard.js');
$this->tpl->assign('datatableObject', $this->datatableObject);
parent::init();
}
示例4: initConstants
/**
* Load application constant
*
* Load module constant if database is loaded
*/
private function initConstants()
{
require $this->di->get('config')->get('global', 'centreon_path') . '/core/internal/Constant.php';
try {
$this->di->get('db_centreon');
foreach (Module::getModuleList() as $moduleName) {
$modulePath = Module::getModulePath($moduleName);
if (file_exists($modulePath . '/config/Constant.php')) {
require $modulePath . '/config/Constant.php';
}
}
} catch (\Exception $e) {
}
}