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


PHP CCodeModel::rules方法代码示例

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


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

示例1: rules

    public function rules()
    {
        return array_merge(parent::rules(), array(
            array('className,scriptPath', 'required'),
            array('className', 'match', 'pattern'=>'/^\w+$/'),
			array('baseClass', 'match', 'pattern'=>'/^\w+$/', 'message'=>'{attribute} should only contain word characters.'),			
            array('scriptPath', 'validateScriptPath'),
            array('scriptPath', 'sticky'),            
        ));
    }
开发者ID:rapbore,项目名称:comar,代码行数:10,代码来源:BehaviorCode.php

示例2: rules

 public function rules()
 {
     return array_merge(parent::rules(), array(array('moduleID', 'filter', 'filter' => 'trim'), array('moduleID', 'required'), array('moduleID', 'match', 'pattern' => '/^\\w+$/', 'message' => '{attribute} should only contain word characters.')));
 }
开发者ID:conghua1013,项目名称:Yii-Bootstrap-Admin,代码行数:4,代码来源:ModuleCode.php

示例3: rules

 /**
  * Validation rules
  */
 public function rules()
 {
     // Migration scripts
     if ($this->level == $this::CREATE_MIGRATION) {
         return array_merge(parent::rules(), array(array('elementName, migrationPath', 'filter', 'filter' => 'trim'), array('elementName, migrationPath', 'required'), array('migrationPath', 'validateModelPath', 'skipOnError' => true), array('tableName, modelPath, baseClass', 'required'), array('elementName, tableName, modelPath', 'match', 'pattern' => '/^(\\w+[\\w\\.]*|\\*?|\\w+\\.\\*)$/', 'message' => '{attribute} should only contain word characters, dots, and an optional ending asterisk.'), array('elementFields', 'validateElementFields', 'skipOnError' => true)));
     } else {
         if ($this->level == $this::CREATE_FILES) {
             return array_merge(parent::rules(), array(array('modelClass, baseClass', 'match', 'pattern' => '/^[a-zA-Z_]\\w*$/', 'message' => '{attribute} should only contain word characters.'), array('modelClass', 'validateModelClass'), array('modelPath', 'validateModelPath', 'skipOnError' => true), array('baseClass, tableName, modelClass, modelPath', 'filter', 'filter' => 'trim'), array('baseClass, modelClass', 'validateReservedWord', 'skipOnError' => true), array('baseClass', 'validateBaseClass', 'skipOnError' => true), array('controllerClass', 'match', 'pattern' => '/^\\w+[\\w+\\/]*$/', 'message' => '{attribute} should only contain word characters and slashes.'), array('baseControllerClass', 'match', 'pattern' => '/^[a-zA-Z_]\\w*$/', 'message' => '{attribute} should only contain word characters.'), array('baseControllerClass', 'validateReservedWord', 'skipOnError' => true)));
         }
     }
 }
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:14,代码来源:ElementCode.php

示例4: rules

 public function rules()
 {
     return array_merge(parent::rules(), array(array('baseClass, widgetClass, widgetPath', 'filter', 'filter' => 'trim'), array('baseClass, widgetClass, widgetPath', 'required'), array('widgetPath', 'match', 'pattern' => '/^(\\w+[\\w\\.]*|\\*?|\\w+\\.\\*)$/', 'message' => '{attribute} should only contain word characters, dots, and an optional ending asterisk.'), array('widgetClass, baseClass', 'match', 'pattern' => '/^[a-zA-Z_]\\w*$/', 'message' => '{attribute} should only contain word characters.'), array('widgetPath', 'validateWidgetPath', 'skipOnError' => true), array('baseClass, widgetClass', 'validateReservedWord', 'skipOnError' => true), array('baseClass', 'validateBaseClass', 'skipOnError' => true), array('baseClass', 'sticky')));
 }
开发者ID:kot-ezhva,项目名称:ygin,代码行数:4,代码来源:YginWidgetCode.php

示例5: rules

 public function rules()
 {
     return array_merge(parent::rules(), array(array('tablePrefix, baseClass, tableName, modelClass, modelPath', 'filter', 'filter' => 'trim'), array('tableName, modelPath, baseClass', 'required'), array('tablePrefix, tableName, modelPath', 'match', 'pattern' => '/^(\\w+[\\w\\.]*|\\*?|\\w+\\.\\*)$/', 'message' => '{attribute} should only contain word characters, dots, and an optional ending asterisk.'), array('tableName', 'validateTableName', 'skipOnError' => true), array('tablePrefix, modelClass, baseClass', 'match', 'pattern' => '/^\\w+$/', 'message' => '{attribute} should only contain word characters.'), array('modelPath', 'validateModelPath', 'skipOnError' => true), array('baseClass', 'validateBaseClass', 'skipOnError' => true), array('tablePrefix, modelPath, baseClass', 'sticky')));
 }
开发者ID:jefftulsa,项目名称:TrackStar,代码行数:4,代码来源:ModelCode.php

示例6: rules

 public function rules()
 {
     return array_merge(parent::rules(), array(array('enumerableName, enumerablePath, baseClass, author', 'filter', 'filter' => 'trim'), array('enumerableName, enumerablePath, baseClass, enumerableItems', 'required'), array('enumerableName, enumerablePath', 'match', 'pattern' => '/^(\\w+[\\w\\.]*|\\*?|\\w+\\.\\*)$/', 'message' => '{attribute} should only contain word characters, dots, and an optional ending asterisk.'), array('baseClass', 'match', 'pattern' => '/^[a-zA-Z_][\\w\\\\]*$/', 'message' => '{attribute} should only contain word characters and backslashes.'), array('enumerablePath', 'validateEnumerablePath', 'skipOnError' => true), array('baseClass', 'validateReservedWord', 'skipOnError' => true), array('baseClass', 'validateBaseClass', 'skipOnError' => true), array('enumerableName, enumerablePath, baseClass', 'sticky'), array('enumerableItems', 'validateEnumerableItems', 'skipOnError' => true), array('author', 'safe')));
 }
开发者ID:yii-ext,项目名称:gii-enum-generator,代码行数:4,代码来源:EnumerableCode.php

示例7: rules

 /**
  * (non-PHPdoc)
  * @see CCodeModel::rules()
  */
 public function rules()
 {
     return array_merge(parent::rules(), array(array('workflowPath', 'validateWorkflowPath'), array('workflowPath', 'sticky'), array('workflowName', 'required'), array('workflowName, messageCategory', 'match', 'pattern' => '/^\\w+$/', 'message' => '{attribute} should only contain word characters.'), array('messageCategory', 'validateMessageCategory'), array('yedfile_upload,enableI8N', 'safe')));
 }
开发者ID:honglei619,项目名称:simpleWorkflow,代码行数:8,代码来源:SimpleWorkflowCode.php

示例8: rules

 public function rules()
 {
     return array_merge(parent::rules(), array(array('model, controller', 'filter', 'filter' => 'trim'), array('model, controller, baseControllerClass', 'required'), array('model', 'match', 'pattern' => '/^\\w+[\\w+\\.]*$/', 'message' => '{attribute} should only contain word characters and dots.'), array('controller', 'match', 'pattern' => '/^\\w+[\\w+\\/]*$/', 'message' => '{attribute} should only contain word characters and slashes.'), array('baseControllerClass', 'match', 'pattern' => '/^[a-zA-Z_]\\w*$/', 'message' => '{attribute} should only contain word characters.'), array('baseControllerClass', 'validateReservedWord', 'skipOnError' => true), array('model', 'validateModel'), array('baseControllerClass', 'sticky')));
 }
开发者ID:israelCanul,项目名称:Bonanza_V2,代码行数:4,代码来源:CrudCode.php

示例9: rules

 public function rules()
 {
     return array_merge(parent::rules(), array(array('modelPath, fixturePath', 'filter', 'filter' => 'trim'), array('modelPath, fixturePath', 'required'), array('rowsLimit', 'numerical', 'allowEmpty' => true)));
 }
开发者ID:asdmundt,项目名称:templateYiiApp,代码行数:4,代码来源:FixtureCode.php

示例10: rules

 public function rules()
 {
     return array_merge(parent::rules(), array(array('name', 'required'), array('applications', 'required')));
 }
开发者ID:salem-dev-acc,项目名称:yiiapp,代码行数:4,代码来源:RestCode.php

示例11: rules

 public function rules()
 {
     return array_merge(parent::rules(), array(array('controller, actions, baseClass', 'filter', 'filter' => 'trim'), array('controller, baseClass', 'required'), array('controller', 'match', 'pattern' => '/^\\w+[\\w+\\/]*$/', 'message' => '{attribute} should only contain word characters and slashes.'), array('actions', 'match', 'pattern' => '/^\\w+[\\w\\s,]*$/', 'message' => '{attribute} should only contain word characters, spaces and commas.'), array('baseClass', 'match', 'pattern' => '/^\\w+$/', 'message' => '{attribute} should only contain word characters.'), array('baseClass, actions', 'sticky')));
 }
开发者ID:hansenmakangiras,项目名称:yiiframework-cms,代码行数:4,代码来源:ControllerCode.php

示例12: rules

 public function rules()
 {
     return array_merge(parent::rules(), array(array('blockName', 'required'), array('blockName', 'match', 'pattern' => '/^\\w+/')));
 }
开发者ID:nganhtuan63,项目名称:gxc-cms,代码行数:4,代码来源:BlockCode.php

示例13: rules

 /**
  * @inheritdoc
  */
 public function rules()
 {
     return array_merge(parent::rules(), array(array('modelClass, modelPath', 'filter', 'filter' => 'trim'), array('modelPath', 'required'), array('modelPath', 'match', 'pattern' => '/^(\\w+[\\w\\.]*)$/', 'message' => '{attribute} should only contain word characters and dots.'), array('modelClass', 'match', 'pattern' => '/^[a-zA-Z_]\\w*$/', 'message' => '{attribute} should only contain word characters.'), array('modelPath', 'validateModelPath', 'skipOnError' => true), array('modelPath,addModelMethodDoc,useMixin', 'sticky'), array('addModelMethodDoc,useMixin', 'numerical', 'integerOnly' => true)));
 }
开发者ID:cornernote,项目名称:gii-modeldoc-generator,代码行数:7,代码来源:ModelDocCode.php

示例14: rules

 public function rules()
 {
     return array_merge(parent::rules(), array(array('controller, actions, baseClass', 'filter', 'filter' => 'trim'), array('controller, baseClass', 'required'), array('controller', 'match', 'pattern' => '/^\\w+[\\w+\\/]*$/', 'message' => '{attribute} should only contain word characters and slashes.'), array('actions', 'match', 'pattern' => '/^\\w+[\\w\\s,]*$/', 'message' => '{attribute} should only contain word characters, spaces and commas.'), array('baseClass', 'match', 'pattern' => '/^[a-zA-Z_\\\\][\\w\\\\]*$/', 'message' => '{attribute} should only contain word characters and backslashes.'), array('baseClass', 'validateReservedWord', 'skipOnError' => true), array('baseClass, actions', 'sticky')));
 }
开发者ID:omonra,项目名称:blog,代码行数:4,代码来源:ControllerCode.php

示例15: rules

 public function rules()
 {
     return array_merge(parent::rules(), array(array('model, controller, name, name_one_preposition, name_many_nominative, name_one_accusative, name_many_genitive, name_many_instrumentative', 'filter', 'filter' => 'trim'), array('model, controller, baseControllerClass, name, name_many_nominative, name_one_accusative, name_many_genitive, name_many_instrumentative', 'required'), array('model', 'match', 'pattern' => '/^\\w+[\\w+\\.]*$/', 'message' => '{attribute} should only contain word characters and dots.'), array('controller', 'match', 'pattern' => '/^\\w+[\\w+\\/]*$/', 'message' => '{attribute} should only contain word characters and slashes.'), array('baseControllerClass', 'match', 'pattern' => '/^\\w+$/', 'message' => '{attribute} should only contain word characters.'), array('model', 'validateModel'), array('baseControllerClass', 'sticky')));
 }
开发者ID:BGCX261,项目名称:zoomtyre-svn-to-git,代码行数:4,代码来源:CrudruCode.php


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