<li><code>admin/user</code> generates <code>UserController.php</code> within the <code>admin</code> module.</li>
</ul>',
'actions'=>'Provide one or multiple action IDs to generate empty action method(s) in the controller. Separate multiple action IDs with commas or spaces.',
'ns'=>'This is the namespace that the new controller class will should use.',
'baseClass'=>'This is the class that the new controller class will extend from. Please make sure the class exists and can be autoloaded.',
);
}
publicfunctionsuccessMessage()
{
$link=Html::a('try it now',Yii::$app->getUrlManager()->createUrl($this->controller),array('target'=>'_blank'));
$actions=$this->getActionIDs();
if(in_array('index',$actions)){
$route=$this->controller.'/index';
}else{
$route=$this->controller.'/'.reset($actions);
}
$link=Html::a('try it now',Yii::$app->getUrlManager()->createUrl($route),array('target'=>'_blank'));
return"The controller has been generated successfully. You may $link.";
}
...
...
@@ -79,13 +105,13 @@ class Generator extends \yii\gii\Generator