本文整理汇总了PHP中Component::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Component::init方法的具体用法?PHP Component::init怎么用?PHP Component::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Component
的用法示例。
在下文中一共展示了Component::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
function init()
{
$result = parent::init();
$this->registerContentTypes();
\Bonita\Main::additionalPath(dirname($this->getFilename()));
return $result;
}
示例2: init
/**
* Initializes the application component.
* This method overrides the parent implementation by setting default cache key prefix.
*/
public function init()
{
parent::init();
if ($this->keyPrefix === null) {
$this->keyPrefix = '';
//Yaf_Application::app()->get_id();
}
}
示例3: foreach
function __construct($aMainTabs = false)
{
parent::init();
if (!empty($aMainTabs)) {
foreach ($aMainTabs as $key => $title) {
$this->items[$title] = array('title' => $title, 'counter' => false, 'sub' => array());
}
}
}
示例4: init
/**
* @return $this
*/
public function init()
{
if (empty($this->protocol) and !empty($_SERVER['SERVER_PROTOCOL'])) {
$this->protocol = strtolower(preg_replace('!/(.*)$!', '', $_SERVER['SERVER_PROTOCOL']));
}
if (empty($this->hostName) and !empty($_SERVER[strtoupper($this->protocol) . '_HOST'])) {
$this->hostName = $_SERVER[strtoupper($this->protocol) . '_HOST'];
}
return parent::init();
}
示例5: init
/**
* Constructor
*
* @return void
*/
protected function init()
{
parent::init();
if (defined('DOING_AJAX') && DOING_AJAX) {
$action = filter_var(isset($_REQUEST['action']) ? $_REQUEST['action'] : '', FILTER_SANITIZE_STRING);
if (method_exists($this, $action)) {
// hook into action if it's method exists
add_action('wp_ajax_' . $action, [&$this, $action]);
}
}
}
示例6: init
public function init()
{
parent::init();
$this->module_name = mb_strtolower(get_class($this));
$this->module_dir_tpl = $this->module_dir . 'tpl' . DIRECTORY_SEPARATOR . LANG_DEFAULT;
//include global language file
include_once PATH_BASE . 'lang' . DIRECTORY_SEPARATOR . LANG_DEFAULT . '.inc.php';
//include module language file
if (file_exists($this->module_dir . 'lang' . DIRECTORY_SEPARATOR . LANG_DEFAULT . '.inc.php')) {
include_once $this->module_dir . 'lang' . DIRECTORY_SEPARATOR . LANG_DEFAULT . '.inc.php';
if (isset($lang)) {
$this->module_lang =& $lang;
}
$this->errors->setLang($this->module_lang);
}
}
示例7: Component
function _initComponents()
{
$component = new Component();
$component->init($this);
}
示例8: init
/**
* Constructor
*
* @return void
*/
protected function init()
{
parent::init();
}
示例9: testLoadComponents
/**
* testLoadComponents method
*
* @access public
* @return void
*/
function testLoadComponents()
{
$Controller = new ComponentTestController();
$Controller->components = array('RequestHandler');
$Component = new Component();
$Component->init($Controller);
$this->assertTrue(is_a($Controller->RequestHandler, 'RequestHandlerComponent'));
$Controller = new ComponentTestController();
$Controller->plugin = 'test_plugin';
$Controller->components = array('RequestHandler', 'TestPluginComponent');
$Component = new Component();
$Component->init($Controller);
$this->assertTrue(is_a($Controller->RequestHandler, 'RequestHandlerComponent'));
$this->assertTrue(is_a($Controller->TestPluginComponent, 'TestPluginComponentComponent'));
$this->assertTrue(is_a($Controller->TestPluginComponent->TestPluginOtherComponent, 'TestPluginOtherComponentComponent'));
$this->assertFalse(isset($Controller->TestPluginOtherComponent));
$Controller = new ComponentTestController();
$Controller->components = array('Security');
$Component = new Component();
$Component->init($Controller);
$this->assertTrue(is_a($Controller->Security, 'SecurityComponent'));
$this->assertTrue(is_a($Controller->Security->Session, 'SessionComponent'));
$Controller = new ComponentTestController();
$Controller->components = array('Security', 'Cookie', 'RequestHandler');
$Component = new Component();
$Component->init($Controller);
$this->assertTrue(is_a($Controller->Security, 'SecurityComponent'));
$this->assertTrue(is_a($Controller->Security->RequestHandler, 'RequestHandlerComponent'));
$this->assertTrue(is_a($Controller->RequestHandler, 'RequestHandlerComponent'));
$this->assertTrue(is_a($Controller->Cookie, 'CookieComponent'));
}
示例10: init
public function init()
{
parent::init();
if ($this->autoConnect) {
$this->setActive(true);
}
}
示例11: init
/**
* Initiates the form component
*
* @access public
*/
public function init()
{
parent::init();
$this->errors = array();
}
示例12: init
public function init()
{
parent::init();
$this->content = "Hello Yii 2.0";
}
示例13: init
/**
* @return $this
*/
public function init()
{
$this->connect();
return parent::init();
}
示例14: indexFile
public function indexFile($file_path)
{
$file_path = trim($file_path, '/');
$FileInstance = new File(array('init' => false));
if ($this->db) {
$FileInstance->setConnection($this->db);
}
$FileInstance->init();
if ($UnIndexedPage = $FileInstance->findFirstBy('path AND has_been_analyzed', $file_path, false)) {
$ComponentInstance = new Component(array('init' => false));
if ($this->db) {
$ComponentInstance->setConnection($this->db);
}
$ComponentInstance->init();
$ClassInstance = new Klass(array('init' => false));
if ($this->db) {
$ClassInstance->setConnection($this->db);
}
$ClassInstance->init();
$this->log('Analyzing file ' . $UnIndexedPage->path);
$Component = $ComponentInstance->updateComponentDetails($UnIndexedPage, $this);
$Classes = $ClassInstance->updateClassDetails($UnIndexedPage, $Component, $this);
if (!empty($Classes)) {
//AkDebug::debug($Classes);
}
$UnIndexedPage->set('has_been_analyzed', true);
$UnIndexedPage->save();
}
}
示例15: init
function init()
{
$result = parent::init();
return $result;
}