忘写 echo
在下面的视图输出中:
<h1>Edit item: <?php $model->label; ?></h1>你可能会花费很多时间去测试为什么 $model->label 没有值.
错误使用 echo在下面的视图输出中:
<h1>Edit item: <?php echo $this->widget('CWidget'); ?></h1>会提示 "Object of class CWidget could not be converted to string." 类 CWidget 的对象不能转化为字符串。
规则中的数字在模型中的 rules 方法中使用 :
array('count', 'number', 'integerOnly'=>true),然后试试
array('count', 'numeric', 'integerOnly'=>true),最后再使用 'numerical'.
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did8406