como podria cambiar el placeholder de un formulario desde la vista
--- vista
<div class="form_element">
<?php
//$name = $form->get('name');
$this->placeholder('name')->data="text value";
$name= $form->get('name');
echo $formLabel->openTag().$name->getOption('label')." ";
echo $this->formInput($name);
echo $formLabel->closeTag();
?>
</div>
--- form
<?php
/**
* @author César Cancino
* @copyright 2013
*/
namespace Application\Form;
use Zend\Captcha\AdapterInterface as CaptchaAdapter;
use Zend\Form\Element;
use Zend\Form\Form;
use Zend\Captcha;
use Zend\Form\Factory;
class Formulario extends Form
{
public function __construct()
{
parent::__construct();
//CREO LA INSTANCIA DEL OBJETO FACTORY
$factory = new Factory();
$email = $factory-> createElement(array(
'type' => 'Zend\Form\Element\Email',
'name' => 'email',
'options' => array(
'label' => 'mail',
),
'attributes' => array(
'class' => 'input'
),
));
$this->add($email);
$name= $factory->createElement(array(
'type' => 'Zend\Form\Element\Text',
'name' => 'name',
'options' => array(
'label' => 'nombre',
),
'attributes' => array(
'placeholder' => '',
'class' => 'input',
'required' => 'required'
),
));
$this->add($name);
$subname= $factory->createElement(array(
'type' => 'Zend\Form\Element\Text',
'name' => 'subname',
'options' => array(
'label' => 'apellidos',
),
'attributes' => array(
'placeholder' => '',
'class' => 'input',
'required' => 'required'
),
));
$this->add($subname);
$email = $factory-> createElement(array(
'type' => 'Zend\Form\Element\Password',
'name' => 'password',
'options' => array(
'label' => 'password',
),
'attributes' => array(
'class' => 'input'
),
));
$this->add($email);
//botón enviar
$this->add(array(
'name' => 'send',
'attributes' => array(
'type' => 'submit',
'value' => 'Enviar',
'title' => 'Enviar',
'class' => 'btn'
),
));
}
}
?>