0
The Form:
$this->add(array(
'name' => 'valor',
'type' => 'Text',
'attributes' => array(
'required' => true,
'class' => 'form-control',
'maxlength' => '100'
),
'options' => array(
'value' => 10, //Coloquei este valor de propósito
)
));
The view:
$form->get('valor')
print_r() of the value form:
Zend\Form\Element\Text Object (
[attributes:protected] => Array (
[type] => text
[name] => valor
[required] => 1
[class] => form-control [maxlength] => 100
)
[label:protected] => [labelAttributes:protected] => Array ()
[labelOptions:protected] => Array ( )
[messages:protected] => Array ( )
[options:protected] => Array ( [value] => 10 ) [value:protected] =>
)
Thanks my Friend
– HorecioDias