I need to build up a form basing on app configuration (array, not a model) and I wonder is there any way to hire CFrom (Form Builder) for this purpose or do I have to use CHtml instead? Using Form Builder chapter in Official Guide seems to be focused on using model.
I've looked into source code of CForm->__construct() method and found out that model is NULL there by default, which lead me to a conclusion that it is possible to use CForm without a model. But when I used code like this:
$form_config = array ( 'title'=>'Please provide your login credential', 'elements'=>array ( 'username'=>array ( 'type'=>'text', 'maxlength'=>32, ), 'password'=>array ( 'type'=>'password', 'maxlength'=>32, ), ) ); $form = new CForm($form_config); $form->render();
All I got is "Fatal error: Call to a member function isAttributeSafe() on a non-object". Which seems to be telling me that using CForm without model isn't that good idea.