【发布时间】:2013-09-11 16:26:30
【问题描述】:
我正在 Yii 中尝试一个简单的程序
//这是我的模型
<?php
class Create extends CFormModel
{
public $a;
public $b;
public $c;
public $d;
public $e;
public $f;
public function rules() {
return array(
array('a, b, c, d, e, f', 'required'),
array('a, b, c, d, e, f', 'numerical', 'integerOnly' => true),
);
}
}
?>
// this is the action in my controller
public function actionCreate()
{
$model = new Create;
$this->render('create',$model);
}
// this is my view
<?php
$form=$this->beginWidget('CActiveForm');
echo $form->textField($model,'a');
$this->endWidget();
?>
我收到此错误..
致命错误:在非对象上调用成员函数 getValidators() 在 C:\xampp\htdocs\crudyii\framework\web\helpers\CHtml.php 上线 第2236章
提前致谢。
【问题讨论】:
-
我们也需要您的查看代码。