本文整理匯總了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) {
}
}