Form Builder values

Hi Guys,

I've started playing with the Form Builder feature and I seem to be missing something very obvious here. How do you set a field value?

Let's say I have a simple class: ```php class PageEditForm extends Form {
public function initialize() {
$this->add(new TextArea("html"));
} } ``` Just like in the form builder example from the documentation, I can then create an object of this class in my controller. But how could I set a value for the field I've created here? Is there a way to do it through the form class? Like: ```php $form->setValue('html', 'my value'); ``` Or do I need to go explicitly through \Phalcon\Tag? ```php Phalcon\Tag::setDefaults ```

Thanks



1.8k

Hi.

value from entity. ```php class PageEditForm extends Form{ public $html = 'this is html'; public function initialize(){ $this->setEntity($this); $this->add(new TextArea("html")); } } ```

value from parameter. ```php class PageEditForm extends Form{ public function initialize(){ $this->add(new TextArea("html", array('value'=>'this is html'))); } } ```