I
I
ilysion_in_life2017-06-15 10:26:29
Yii
ilysion_in_life, 2017-06-15 10:26:29

Editing JSON data in CActiveForm yii1?

bool(true) tried to just pass the variable to the view $this->render('update',array('params' => $params)); and in it
<?php $form=$this->beginWidget('CActiveForm');?>
<?php echo $form->textField($params,'title', array('class'=>'text')); ?>
<?php $this->endWidget(); ?>
but I get
Fatal error: Call to a member function getValidators() on null in C:\OpenServer\domains\tester1.ru\2\framework\web\helpers\CHtml.php on line 2236

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-06-15
@webinar

CActiveForm means working with an object that is an instance of the CModel class.
And the error says that when you try to access the getValidators () method, it turned out that it does not exist. And it also cannot be in a normal array. So you need to create a model, load data from the array into it, and then use CActiveForm or build the form differently. For example, using the same CHtml.
I highly recommend reading the guide: www.yiiframework.com/doc/guide before doing anything else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question