yiic does support customized template views. Simply put your template files under "framework/cli/views/shell/crud" and they will be used. For more details, see doc of CrudCommand::templatePath.
* If you set this path and some views are missing in the directory,
the default views will be used.
so i suggest to define always the templatePath to "application.commands.shell.crud" so if someone like to change the crud-template for one project he only have to put the files in that directory.
If the directory is empty, the command uses the default-templates…
Sorry, I was wrong. In order to use your own set of crud templates, you will have to extend CrudCommand, put the child class under protected/commands/shell.
In your child class' constructor, you can set templatePath by calling Yii::getPathOfAlias.
Could you perhaps share your example? I tried to do the same thing (extend CrudCommand) but I had to include the CrudCommand.php explicitly in order to avoid an error message (Bad File Descriptor).
first create a new command under <your-app>/protected/commands/shell
it look lilke this:
Yii::import('system.cli.commands.shell.CrudCommand');
class yourCrudCommand extends CrudCommand
{
public function __construct(){
$this->templatePath = Yii::getPathOfAlias("application.commands.views.shell.crud");
}
}
now copy the view-files you like to change from framework path (<yii>/framework/cli/views/crud) and put it in <your-app>/protected/command/views/shell/crud. Here you can modify the templates like you wish.
After that go in console to <your-app> path and (re-) call yiic from there, type help.
Now you should see a new command entry for 'yourCrudCommand'.
By calling the new command, yiic should now take your templates from