array('modelClass, viewPath','match','pattern'=>'/^@?\w+[\\-\\/\w+]*$/','message'=>'Only word characters, dashes, slashes and @ are allowed.'),
array('modelClass','match','pattern'=>'/^[\w\\\\]*$/','message'=>'Only word characters and backslashes are allowed.'),
array('viewName','match','pattern'=>'/^\w+[\\-\\/\w+]*$/','message'=>'Only word characters, dashes and slashes are allowed.'),
array('modelClass','validateModel'),
array('modelClass','validateModel'),
array('viewName','match','pattern'=>'/^\w+[\\-\\/\w]*$/','message'=>'Only word characters, dashes and slashes are allowed.'),
array('viewPath','match','pattern'=>'/^@?\w+[\\-\\/\w]*$/','message'=>'Only word characters, dashes, slashes and @ are allowed.'),
array('viewPath','validateViewPath'),
array('viewPath','validateViewPath'),
array('scenarioName','match','pattern'=>'/^\w+$/','message'=>'Only word characters are allowed.'),
array('scenarioName','match','pattern'=>'/^[\w\\-]+$/','message'=>'Only word characters and dashes are allowed.'),
));
));
}
}
/**
* @inheritdoc
*/
publicfunctionattributeLabels()
publicfunctionattributeLabels()
{
{
returnarray(
returnarray(
...
@@ -77,6 +83,9 @@ class Generator extends \yii\gii\Generator
...
@@ -77,6 +83,9 @@ class Generator extends \yii\gii\Generator
);
);
}
}
/**
* @inheritdoc
*/
publicfunctionrequiredTemplates()
publicfunctionrequiredTemplates()
{
{
returnarray(
returnarray(
...
@@ -99,20 +108,32 @@ class Generator extends \yii\gii\Generator
...
@@ -99,20 +108,32 @@ class Generator extends \yii\gii\Generator
publicfunctionhints()
publicfunctionhints()
{
{
returnarray(
returnarray(
'modelClass'=>'This is the model class for collecting the form input. You should provide a fully qualified class name, e.g., <code>app\models\Post</code>.',
'viewName'=>'This is the view name with respect to the view path. For example, <code>site/index</code> would generate a <code>site/index.php</code> view file under the view path.',
'viewPath'=>'This is the root view path to keep the generated view files. You may provide either a directory or a path alias, e.g., <code>@app/views</code>.',
'scenarioName'=>'This is the scenario to be used by the model when collecting the form input. If empty, the default scenario will be used.',