Crud Generation

Now that I have been working with the Yii framework and the CConsoleCommand ([tt]CrudCommand[/tt]), I have a few comments/suggestions:

  • Would it be a good idea to make the viewpath variable of the [tt]CrudCommand[/tt] also public? My own crud templates need to be generated in the 'views' folder of a theme, rather than the default 'views' folder.
  • Add a check to the [tt]CrudCommand[/tt] which verifies whether the Model Class file (as given by the user) indeed exists. In my own [tt]CrudCommand[/tt] I have added such a check and throws a [tt]ShellException[/tt] if the file does not exist.
  • When a ShellCommand generates a PHP error, the error message and stack trace is shown in HTML format. I reckon this output is in non HTML much better.

Thanks and regards,

Sacha Telgenhof

  1. You can set Yii::app()->viewPath to the theme view path in your customized crud command.

  2. We don't really enforce the location of a model class. So it is impossible to check the existence of the model class.

  3. I think it is the current behavior that exceptions are show in plain text rather than HTML format.