I think it would be a good idea if the crud generated by yiic created the menus within a widget. I am talking about the menus generated in the views, eg "Create Post" "Modify Post". Right now it simply has a list of links like so:
. I think it would be better if it did something like this:
I am not sure whether or not we should go much further in making the code generated by crud more powerful. While some users may want the default generate code to be quite usable already, some other users may not like this because it could be less intuitive or take more time to adapt it to fit for special needs.
In general, I think it is more useful to let people know how to customize the model/crud templates rather than writing complicated yet powerful default templates.
Below is part of the "view.php" file that is generated by my customized crud template:
<?php
$this->pageTitle=t('View News');
$this->crumbs=array(
t('News')=>array('news/list'),
$model->title,
);
$this->operations=array(
t('List News')=>array('news/list'),
t('Create News')=>array('news/insert'),
t('Related Contents')=>array('news/links','id'=>$model->id),
t('Update This News')=>array('news/update','id'=>$model->id),
CHtml::linkButton(t('Delete This News'),array(
'submit'=>array('news/delete','id'=>$model->id),
'confirm'=>t('Are you sure to delete this news?'),
)));
?>
<h1><?php echo t('View News'); ?></h1>
The corresponding part of the screenshot is attached to this post. As you can see, in this view template, we don’t use menu widget at all, but we are still able to generate the needed menu items.