Yii Framework Forum: rules in public function of model don't do its job correctly - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

rules in public function of model don't do its job correctly [solved]

#1 User is offline   tklustig 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 421
  • Joined: 20-April 17
  • Location:Hannover

Posted 12 May 2018 - 03:01 PM

Hi guys, I'm using following rules in model
   public function rules() {        return [[['beurteilung_fachlich', 'beurteilung_persoenlich', 'sonstiges', 'anschreiben'], 'string'],[['anschreiben'], 'string', 'max' => 255]];    }
Although threre is nowhere any restriction for attribute beurteilung_persoenlich, I will get error of formular validation:Beurteilung(fachlich) must not be longer as two hundred fifty five chars!(see my attachement,please)How can this be??What do I wrong?Is there another place reglementing formular values but in model?Database has datatype TEXT without any bondary.Here is code of formular:
<div class="col-md-6">field($model, 'beurteilung_fachlich')>widget(\dosamigos\ckeditor\CKEditor::className(), ['preset' => 'full', 'clientOptions' => ['height' => 200]])?></div>

Attached File(s)


0

#2 User is offline   TinweDeveloper 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 30-November 17

Posted 15 May 2018 - 03:04 PM

View Posttklustig, on 12 May 2018 - 03:01 PM, said:

Hi guys, I'm using following rules in model
   
public function rules() {        
return [[['beurteilung_fachlich', 'beurteilung_persoenlich', 'sonstiges', 'anschreiben'], 'string'],
[['anschreiben'], 'string', 'max' => 255]];    
}

Although threre is nowhere any restriction for attribute beurteilung_persoenlich, I will get error of formular validation:
Beurteilung(fachlich) must not be longer as two hundred fifty five chars!(see my attachement,please)
How can this be??
What do I wrong?
Is there another place reglementing formular values but in model?
Database has datatype TEXT without any bondary.

Here is code of formular:

<div class="col-md-6">
<?=$form->field($model, 'beurteilung_fachlich')>widget(\dosamigos\ckeditor\CKEditor::className(), ['preset' => 'full', 'clientOptions' => ['height' => 200]])
?>
</div>




You don't have -> behind widget.
Try remove 'anschreiben' from first array.
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users