I have Login.php form like this:
class Form_Login extends Zend_Form {
public function init() {
}
public function __construct(){
// Set method
$this->setMethod('post');
$elements = array();
$element = $this->createElement('text','username');
$element->setRequired(true);
$elements[] = $element;
$element = $this->createElement('password','password');
$element->setRequired(true);
$elements[] = $element;
$this->addElements( $elements );
$this->setDecorators( array( array( 'viewScript', array( 'viewScript' => '/authentication/login-form.phtml' ) ) ) );
}
}
/authentication/login-form.phtml
<table>
<tr>
<td><?= $this->getElement('username') ?></td>
</tr>
<tr>
<td><?= $this->getElement('password') ?></td>
</tr>
</table>
When I render the form thenI get following exception:
Message: Plugin by name 'GetElement' was not found in the registry; used paths: Zend_View_Helper_: Zend/View/Helper/;C:/wamp/www/databox/application/views\helpers/
Where I am going wrong. Should I enter any information in application.ini or Bootstrap.
Thanks
You need to pass the form to your view script to make it work.
in your view script you can receive the elements via