yii: just trying to show a form using form builder

Hi,

I’m just trying to show a form using form builder, but the form is not showed… This is the code:

register.php


entered here

<div class="form">

   <?php echo $form?>

</div>

RegisterForm.php


class RegisterForm extends CFormModel {


    public $name;

}

MyController.php


public function actionRegister()

{   

    $model = new RegisterForm();


    $config=array(

            'elements'=>array(

                'name'=>array(

                    'type'=>'text',

                    ),  

                ),  

            );  


    $form = new CForm($config, $model);


    $this->render('register', array('form' => $form));

 }  

Javier

Hey Javier,

Read these usefull links :

Create Model Form

Create Form

i hope it will sort out your problem ;)