Error

Call to a member function getValidators() on null

/homepages/18/d497956370/htdocs/reforward/framework/web/helpers/CHtml.php(2435)

2423      * @param array $htmlOptions additional HTML attributes for the HTML tag
2424      * @return string the generated input tag
2425      */
2426     protected static function activeInputField($type,$model,$attribute,$htmlOptions)
2427     {
2428         $htmlOptions['type']=$type;
2429         if($type==='text'||$type==='password'||$type==='color'||$type==='date'||$type==='datetime'||
2430             $type==='datetime-local'||$type==='email'||$type==='month'||$type==='number'||$type==='range'||
2431             $type==='search'||$type==='tel'||$type==='time'||$type==='url'||$type==='week')
2432         {
2433             if(!isset($htmlOptions['maxlength']))
2434             {
2435                 foreach($model->getValidators($attribute) as $validator)
2436                 {
2437                     if($validator instanceof CStringValidator && $validator->max!==null)
2438                     {
2439                         $htmlOptions['maxlength']=$validator->max;
2440                         break;
2441                     }
2442                 }
2443             }
2444             elseif($htmlOptions['maxlength']===false)
2445                 unset($htmlOptions['maxlength']);
2446         }
2447 

Stack Trace

#2
+
 /homepages/18/d497956370/htdocs/reforward/protected/views/cabinet/tabs/_profile.php(24): CActiveForm->textField(null, "login", array("placeholder" => "Введите логин"))
19         'htmlOptions' => array('class' => 'edit-form')
20     )); ?>
21     <div class="row">
22             <span class="span4">
23                 <div>
24                     <?=$form->textField($user, 'login', array('placeholder' => "Введите логин"));?>
25                 </div>
26             </span><!--/.span4-->
27             <span class="span4">
28                 <div>
29                     <?=$form->textField($user, 'email', array('placeholder' => "Введите e-mail"));?>
#6
+
 /homepages/18/d497956370/htdocs/reforward/protected/views/cabinet/index.php(23): CController->renderPartial("tabs/_profile", array("user" => null, "tab" => "newOrder", "countries" => array(Country, Country, Country, Country, ...)))
18     <li class="<?=$tab == 'profile' ? 'current ' : '';?>span4"><h4>Персональная информация</h4></li>
19 </ul><!--/.tabs-->
20 <?php $this->showMessages(); ?>
21 <?php $this->renderPartial('tabs/_newOrder', compact('goods', 'newOrder', 'tab')); ?>
22 <?php $this->renderPartial('tabs/_myOrders', compact('myOrders', 'tab')); ?>
23 <?php $this->renderPartial('tabs/_profile', compact('user', 'tab', 'countries', 'addresses', 'jsonCountries')); ?>
24 
25 
26 
27 </div><!--/.container-->
28 
#11
+
 /homepages/18/d497956370/htdocs/reforward/protected/controllers/CabinetController.php(172): CController->render("index", array("newOrder" => Order, "goods" => array(Good), "myOrders" => array(), "user" => null, ...))
167                 }
168             }
169         }
170 
171 
172         $this->render('index', compact('newOrder', 'goods', 'myOrders', 'user', 'tab', 'countries'));
173     }
174 }
175 
2024-03-29 16:30:09 Apache Yii Framework/1.1.16