当前位置: 首页>>代码示例>>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;未经允许,请勿转载。