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