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


PHP CCodeModel::init方法代码示例

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


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

示例1: init

 public function init()
 {
     if (Yii::app()->db === null) {
         throw new CHttpException(500, 'An active "db" connection is required to run this generator.');
     }
     parent::init();
 }
开发者ID:israelCanul,项目名称:Bonanza_V2,代码行数:7,代码来源:CrudCode.php

示例2: init

 public function init()
 {
     if (Yii::app()->{$this->connectionId} === null) {
         throw new CHttpException(500, 'A valid database connection is required to run this generator.');
     }
     $this->tablePrefix = Yii::app()->{$this->connectionId}->tablePrefix;
     parent::init();
 }
开发者ID:42point,项目名称:Vinum,代码行数:8,代码来源:ModelCode.php

示例3: init

 /**
  * Runs on object initiation
  */
 public function init()
 {
     // Check database connection
     if (Yii::app()->db === null) {
         throw new CHttpException(500, 'An active "db" connection is required to run this generator.');
     }
     // Check that reset button has been pressed
     if (isset($_POST['reset'])) {
         $this->resetGenerator();
     }
     // Refresh element name from session variable if on second pass
     if (isset(Yii::app()->session['elementName'])) {
         $this->elementName = Yii::app()->session['elementName'];
     } else {
         $this->elementName = "";
     }
     // Refresh table name from session variable if on second pass
     if (isset(Yii::app()->session['tableName'])) {
         $this->tableName = Yii::app()->session['tableName'];
         $this->modelClass = $this->generateClassName($this->tableName);
     } else {
         $this->tableName = "";
     }
     // Set default variables
     $this->elementFields = "'value' => 'string',";
     $this->controllerClass = $this->generateControllerName($this->modelClass);
     $this->baseControllerClass = 'Controller';
     $this->modelPath = 'application.models.elements';
     $this->baseClass = 'BaseElement';
     $this->ignore = array('id', 'event_id', 'created_user_id', 'created_date', 'last_modified_user_id', 'last_modified_date');
     $this->migrationPath = 'application.migrations';
     $this->authorName = Yii::app()->params['authorName'];
     $this->authorEmail = Yii::app()->params['authorEmail'];
     // Set progress level
     if (isset(Yii::app()->session['level'])) {
         $this->level = Yii::app()->session['level'];
     } else {
         $this->level = self::CREATE_MIGRATION;
     }
     parent::init();
 }
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:44,代码来源:ElementCode.php


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