當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CWebModule::init方法代碼示例

本文整理匯總了PHP中CWebModule::init方法的典型用法代碼示例。如果您正苦於以下問題:PHP CWebModule::init方法的具體用法?PHP CWebModule::init怎麽用?PHP CWebModule::init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CWebModule的用法示例。


在下文中一共展示了CWebModule::init方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 public function init()
 {
     Controller::initParams();
     // this method is called when the module is being created
     // you may place code here to customize the module or the application
     Yii::app()->setComponent('bootstrap', array('class' => 'ext.bootstrap.components.Bootstrap', 'responsiveCss' => true));
     Yii::setPathOfAlias('bootstrap', dirname(__FILE__) . DIRECTORY_SEPARATOR . '../../extensions/bootstrap');
     Yii::app()->bootstrap->init();
     // import the module-level models and components
     $this->setImport(array('admin.models.*', 'admin.components.*'));
     Yii::app()->setComponents(array('user' => array('class' => 'AdminUser', 'loginUrl' => Yii::app()->createAbsoluteUrl('admin/login'), 'allowAutoLogin' => true)), true);
     $this->layout = 'application.modules.admin.views.layouts.column1';
     if (Yii::app()->params['STORE_OFFLINE'] == '-1') {
         die('Admin Panel unavailable due to account suspension.');
     }
     if (isset($_POST['url']) && isset($_POST['password'])) {
         $model = new LoginForm();
         if ($model->loginLightspeed($_POST['user'], $_POST['password'])) {
             Yii::app()->getRequest()->redirect(Yii::app()->createUrl("/admin"));
         } else {
             die("You have an invalid password set in your eCommerce options. Cannot continue.");
         }
     }
     if (!Yii::app()->user->isGuest) {
         if (Yii::app()->user->shouldLogOut()) {
             Yii::app()->user->logout(false);
         }
     }
     _xls_set_conf('ADMIN_PANEL', date("Y-m-d H:i:s"));
     parent::init();
 }
開發者ID:uiDeveloper116,項目名稱:webstore,代碼行數:31,代碼來源:AdminModule.php

示例2: init

 /**
  * Initializes the admin module.
  */
 public function init()
 {
     parent::init();
     Yii::setPathOfAlias('admin', dirname(__FILE__));
     Yii::app()->setComponents(array('errorHandler' => array('class' => 'CErrorHandler', 'errorAction' => $this->getId() . '/default/error'), 'user' => array('class' => 'WebUser', 'stateKeyPrefix' => 'admin', 'loginUrl' => Yii::app()->createUrl($this->getId() . '/default/login')), 'widgetFactory' => array('class' => 'CWidgetFactory', 'widgets' => array())), false);
     $this->setImport(array('admin.models.*', 'admin.components.*'));
 }
開發者ID:jackycgq,項目名稱:advanced,代碼行數:10,代碼來源:AdminModule.php

示例3: init

 public function init()
 {
     parent::init();
     Yii::app()->setComponents(array('errorHandler' => array('class' => 'CErrorHandler', 'errorAction' => 'siteadmin/default/error'), 'user' => array('class' => 'BackendUser', 'stateKeyPrefix' => 'siteadmin2', 'loginUrl' => Yii::app()->createUrl('siteadmin/default/login'), 'allowAutoLogin' => true, 'sitePart' => 'siteadmin')), false);
     Yii::app()->user->setReturnUrl(Yii::app()->createUrl('siteadmin'));
     Yii::app()->user->allowAutoLogin = true;
 }
開發者ID:yasirgit,項目名稱:hotmall,代碼行數:7,代碼來源:SiteadminModule.php

示例4: init

 public function init()
 {
     parent::init();
     $moduleId = $this->getId();
     $this->setImport(array($moduleId . '.components.*', $moduleId . '.models.*', $moduleId . '.widgets.*'));
     $this->checkDependencies();
 }
開發者ID:jayrulez,項目名稱:kcconline,代碼行數:7,代碼來源:WebModule.php

示例5: init

 /**
  * Module constructor - Builds the initial module data
  *
  *
  * @author vadim
  *
  */
 public function init()
 {
     // If the langauge is set then set the application
     // Language appropriatly
     if (isset($_GET['lang']) && in_array($_GET['lang'], array_keys(Yii::app()->params['languages']))) {
         Yii::app()->setLanguage($_GET['lang']);
     }
     // Convert application name
     Yii::app()->name = Yii::app()->settings->applicationName != '' ? Yii::app()->settings->applicationName : Yii::app()->name;
     // Other settings
     if (count(Yii::app()->params)) {
         foreach (Yii::app()->params as $key => $value) {
             // Skip the ones that does not exists
             if (!Yii::app()->settings->{$key}) {
                 continue;
             }
             // Add them anyways
             Yii::app()->params[$key] = Yii::app()->settings->{$key} != '' ? Yii::app()->settings->{$key} : Yii::app()->params[$key];
         }
     }
     // Convert settings into params
     if (count(Yii::app()->settings->settings)) {
         foreach (Yii::app()->settings->settings as $settingKey => $settingValue) {
             Yii::app()->params[$settingKey] = $settingValue;
         }
     }
     parent::init();
 }
開發者ID:hansenmakangiras,項目名稱:yiiframework-cms,代碼行數:35,代碼來源:MasterModule.php

示例6: init

 public function init()
 {
     // this method is called when the module is being created
     // you may place code here to customize the module or the application
     // import the module-level models and components
     parent::init();
 }
開發者ID:andreyantonov78,項目名稱:atmosphera,代碼行數:7,代碼來源:SearchModule.php

示例7: init

 public function init()
 {
     parent::init();
     //module specific classes
     $this->setImport(array('admin.models.*', 'admin.models.forms.*', 'admin.components.*'));
     //module based componets
     $this->setComponents(array('user' => array('class' => 'CWebUser', 'loginUrl' => Yii::app()->createUrl('auth/login'), 'allowAutoLogin' => true, 'autoRenewCookie' => true, 'authTimeout' => 31557600, 'returnUrl' => Yii::app()->createUrl(self::MODULE_KEY . '/default/index'))));
 }
開發者ID:wanyos2005,項目名稱:hsbf,代碼行數:8,代碼來源:AdminModule.php

示例8: init

 function init()
 {
     $this->wtermOptions = array_merge($this->defaultWtermOptions, $this->wtermOptions);
     if ($this->useYiic) {
         $this->registerCommand('yiic', array('yiic'), 'Allows to run <strong>yiic</strong> commands.');
     }
     parent::init();
 }
開發者ID:emisdb,項目名稱:myii,代碼行數:8,代碼來源:WebShellModule.php

示例9: init

 public function init()
 {
     // this method is called when the module is being created
     // you may place code here to customize the module or the application
     // import the module-level models and components
     $this->setImport(array('integration.models.*', 'integration.components.*', 'integration.controllers.*'));
     parent::init();
 }
開發者ID:uiDeveloper116,項目名稱:webstore,代碼行數:8,代碼來源:IntegrationModule.php

示例10: init

 public function init()
 {
     parent::init();
     // this method is called when the module is being created
     // you may place code here to customize the module or the application
     Yii::app()->setComponents(array('errorHandler' => array('errorAction' => 'public/publicSite/page/view/notFound')));
     // import the module-level models and components
     $this->setImport(array('public.models.*', 'public.components.*'));
 }
開發者ID:jankichaudhari,項目名稱:yii-site,代碼行數:9,代碼來源:PublicModule.php

示例11: init

	public function init()
	{
		$this->setImport(array(
			'nfy.models.*',
			'nfy.components.*',
			'users.models.*',
		));
		parent::init();
	}
開發者ID:Aplay,項目名稱:Fastreview_site,代碼行數:9,代碼來源:NfyModule.php

示例12: init

 public function init()
 {
     parent::init();
     $this->setImport(array('admin.components.*', 'admin.models.*'));
     Yii::app()->setComponents(array('errorHandler' => array('class' => 'CErrorHandler', 'errorAction' => 'admin/site/error'), 'user' => array('allowAutoLogin' => false, 'class' => 'BWebUser')));
     //$base_dir = $this->getBasePath();
     //$layoutPath = $base_dir.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'layouts';
     //$this->setLayoutPath($layoutPath);
 }
開發者ID:zt123,項目名稱:Base-System,代碼行數:9,代碼來源:AdminModule.php

示例13: init

 /**
  * Module constructor - Builds the initial module data
  *
  *
  * @author vadim
  *
  */
 public function init()
 {
     // If the langauge is set then set the application
     // Language appropriatly
     if (isset($_GET['lang']) && in_array($_GET['lang'], array_keys(Yii::app()->params['languages']))) {
         Yii::app()->setLanguage($_GET['lang']);
     }
     parent::init();
 }
開發者ID:evan70,項目名稱:yii-tracker,代碼行數:16,代碼來源:MasterModule.php

示例14: init

 public function init()
 {
     parent::init();
     // this method is called when the module is being created
     // you may place code here to customize the module or the application
     Yii::app()->urlManager->urlSuffix = '';
     Yii::app()->setComponents(array('errorHandler' => array('errorAction' => 'admin4/Site/error')));
     // import the module-level models and components
     $this->setImport(array('admin4.models.*', 'admin4.components.*', 'admin4.controllers.*'));
 }
開發者ID:jankichaudhari,項目名稱:yii-site,代碼行數:10,代碼來源:Admin4Module.php

示例15: init

 public function init()
 {
     // Load modules
     $modules = CmsModulereg::model()->findAll();
     $modulesConfig = array();
     foreach ($modules as $module) {
         $modulesConfig[] = $module->name;
         $this->setImport(array('cms.modules.' . $module->name . '.*'));
     }
     $this->setModules($modulesConfig);
     $this->setImport(array('cms.models.*', 'cms.components.*', 'cms.widgets.*'));
     parent::init();
 }
開發者ID:rolandschaub,項目名稱:roland-cms,代碼行數:13,代碼來源:CmsModule.php


注:本文中的CWebModule::init方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。