How to use form builder

I can’t get this to work without actually creating html. I’ve read through the documentation. Unless I’m missing something the implication is that Yii will create the basic form html, without a need to specify the html and array elements, like:


<div class="form">


<?php echo CHtml::beginForm(); ?>


    <?php echo CHtml::errorSummary($model); ?>


    <div class="row">

        <?php echo CHtml::activeLabelEx($model,'title'); ?>

        <?php echo CHtml::activeTextField($model,'title',array('size'=>60,'maxlength'=>255)); ?>

        <?php echo CHtml::error($model,'title'); ?>

    </div>


    <div class="row">

        <?php echo CHtml::activeLabelEx($model,'desc'); ?>

        <?php echo CHtml::activeTextArea($model,'desc',array('rows'=>6, 'cols'=>50)); ?>

        <?php echo CHtml::error($model,'desc'); ?>

    </div>


    <div class="row buttons">

        <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>

    </div>


<?php echo CHtml::endForm(); ?>

No matter what I do, unless I specifically include this kind of code, no form shows up. The html is blank. I can specify data by


<div class="row">

        <?php echo $form['title']->renderLabel(); ?>

        <?php echo $form['title']->renderInput(); ?>

    </div>

However the default form is not being created. I must be missing something???

I know this is an old question, but I think in your controller, you needed to call render() method of your view, e.g.

$view->render();

How to build the my form by using CForm in variable fields?

For Example, variable DropDownList data’s, variable number of checkBoxes and …