I have tried the below to display the form fields without the form start and end tag, but it seems that it doesn’t display the errors.
public function render()
{
$output = '';
foreach($this->getElements() as $element)
$output .= $element->render();
return $output;
}
Any ideas why doesn’t it display the errors ?
Take a look at the implementation of
CFormModel::renderhere; there are a few interconnected methods thatrendertaps into immediately following.To specifically answer your question, in line 459 of the above we see
That’s how Yii injects the error summary. And here you can see how a
CFormInputElementrenders itself; again, there is an explicit call to code that renders the error in the methodrenderErrorwhich is below.