本文整理汇总了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'),
));
}
示例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.')));
}
示例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)));
}
}
}
示例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')));
}
示例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')));
}
示例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')));
}
示例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')));
}
示例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')));
}
示例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)));
}
示例10: rules
public function rules()
{
return array_merge(parent::rules(), array(array('name', 'required'), array('applications', 'required')));
}
示例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')));
}
示例12: rules
public function rules()
{
return array_merge(parent::rules(), array(array('blockName', 'required'), array('blockName', 'match', 'pattern' => '/^\\w+/')));
}
示例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)));
}
示例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')));
}
示例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')));
}