當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。