[['viewName'], 'match', 'pattern' => '/^\w+[\\-\\/\w]*$/', 'message' => 'Only word characters, dashes and slashes are allowed.'],
[['viewPath'], 'match', 'pattern' => '/^@?\w+[\\-\\/\w]*$/', 'message' => 'Only word characters, dashes, slashes and @ are allowed.'],
[['viewPath'], 'validateViewPath'],
[['scenarioName'], 'match', 'pattern' => '/^[\w\\-]+$/', 'message' => 'Only word characters and dashes are allowed.'],
]);
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'modelClass' => 'Model Class',
'viewName' => 'View Name',
'viewPath' => 'View Path',
'scenarioName' => 'Scenario',
];
}
/**
* @inheritdoc
*/
public function requiredTemplates()
{
return ['form.php', 'action.php'];
}
/**
* @inheritdoc
*/
public function stickyAttributes()
{
return ['viewPath', 'scenarioName'];
}
/**
* @inheritdoc
*/
public function hints()
{
return [
'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.',