当前位置: 首页>>代码示例>>PHP>>正文


PHP CFormModel::afterConstruct方法代码示例

本文整理汇总了PHP中CFormModel::afterConstruct方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormModel::afterConstruct方法的具体用法?PHP CFormModel::afterConstruct怎么用?PHP CFormModel::afterConstruct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFormModel的用法示例。


在下文中一共展示了CFormModel::afterConstruct方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: afterConstruct

 protected function afterConstruct()
 {
     $this->gs_list = Gs::model()->getOpenServers();
     if (count($this->gs_list) == 1) {
         $this->gs_id = key($this->gs_list);
     }
     parent::afterConstruct();
 }
开发者ID:mmorpg2015,项目名称:ghtweb5,代码行数:8,代码来源:LoginForm.php

示例2: afterConstruct

 /**
  * (non-PHPdoc)
  * @see yii/base/CModel#afterConstruct()
  */
 protected function afterConstruct()
 {
     $this->forceSSL = Yii::app()->settings->get(Setting::FORCE_SSL);
     $this->recentEntryWidgetEnabled = Yii::app()->settings->get(Setting::RECENT_ENTRIES_WIDGET_ENABLED);
     $this->recentEntryWidgetCount = Yii::app()->settings->get(Setting::RECENT_ENTRIES_WIDGET_COUNT);
     $this->mostViewedEntriesWidgetEnabled = Yii::app()->settings->get(Setting::MOST_VIEWED_ENTRIES_WIDGET_ENABLED);
     $this->mostViewedEntriesWidgetCount = Yii::app()->settings->get(Setting::MOST_VIEWED_ENTRIES_WIDGET_COUNT);
     return parent::afterConstruct();
 }
开发者ID:humantech,项目名称:ppma,代码行数:13,代码来源:ApplicationSettingsForm.php

示例3: afterConstruct

 public function afterConstruct()
 {
     $dependency = new CDbCacheDependency("SELECT COUNT(0), MAX(UNIX_TIMESTAMP(updated_at)) FROM {{gs}} WHERE status = :status");
     $dependency->params = array('status' => ActiveRecord::STATUS_ON);
     $dependency->reuseDependentData = TRUE;
     $res = Gs::model()->cache(3600 * 24, $dependency)->opened()->findAll();
     if ($res) {
         foreach ($res as $gs) {
             $this->gs_list[$gs['id']] = $gs;
         }
     }
     unset($res);
     if (count($this->gs_list) == 1) {
         $this->gs_id = key($this->gs_list);
     }
     parent::afterConstruct();
 }
开发者ID:mmorpg2015,项目名称:ghtweb5,代码行数:17,代码来源:ForgottenPasswordForm.php

示例4: afterConstruct

 /**
  * This event is raised after the model instance is created by new operator.
  */
 protected function afterConstruct()
 {
     parent::afterConstruct();
     if ($this->scenario == 'test1') {
         $this->ce_lat = 58.3844382319306;
         $this->ce_lon = 26.7022705078125;
         $this->zoom = 5;
         $this->sw_lat = 58.23785;
         $this->sw_lon = 24.38965;
         $this->ne_lat = 59.46518;
         $this->ne_lon = 27.07031;
     }
     if ($this->scenario == 'test2') {
         $this->ce_lat = null;
         $this->ce_lon = null;
         $this->zoom = null;
         $this->sw_lat = 58.23785;
         $this->sw_lon = 24.38965;
         $this->ne_lat = 59.46518;
         $this->ne_lon = 27.07031;
     }
 }
开发者ID:rizaldi-github,项目名称:Yii-Playground,代码行数:25,代码来源:Map.php

示例5: afterConstruct

    /**
     * @retunr void
     */
    protected function afterConstruct()
    {
        /* @var SettingsComponent $settings */
        /** @noinspection PhpUndefinedFieldInspection */
        $settings = Yii::app()->settings;

        $this->forceSSL = $settings->get(Setting::FORCE_SSL);
        $this->recentEntryWidgetEnabled = $settings->get(Setting::RECENT_ENTRIES_WIDGET_ENABLED);
        $this->recentEntryWidgetCount = $settings->get(Setting::RECENT_ENTRIES_WIDGET_COUNT);
        $this->mostViewedEntriesWidgetEnabled = $settings->get(Setting::MOST_VIEWED_ENTRIES_WIDGET_ENABLED);
        $this->mostViewedEntriesWidgetCount = $settings->get(Setting::MOST_VIEWED_ENTRIES_WIDGET_COUNT);

        parent::afterConstruct();
    }
开发者ID:hersoncruz,项目名称:ppma,代码行数:17,代码来源:ApplicationSettingsForm.php

示例6: afterConstruct

 /**
  * Switch to the password scenario, when we dealing with passwords
  */
 public function afterConstruct()
 {
     parent::afterConstruct();
     if (isset($_POST) && !empty($_POST[__CLASS__]['password'])) {
         $this->scenario .= '_pass';
     }
 }
开发者ID:EurekaSolutions,项目名称:proyectoestudio,代码行数:10,代码来源:HUserInfoForm.php

示例7: afterConstruct

 /**
  * The after construct event, sets the default value of $this->rememberMe
  * @see CFormModel::afterConstruct()
  */
 public function afterConstruct()
 {
     parent::afterConstruct();
     $this->rememberMe = Yii::app()->getModule("users")->autoLoginByDefault;
 }
开发者ID:niranjan2m,项目名称:Voyanga,代码行数:9,代码来源:ALoginForm.php


注:本文中的CFormModel::afterConstruct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。