php - Zend Framework password field rendering as 'text' instead of 'password' -
I'm following with Zend Framework 2.0 by example, and I'm working on a chapter chapter. Everything is working fine, except that my 'password' and 'password-confirmation' fields do not seem to be rendering properly here is a fraction of my RegisterForm.php
file where I have the password field Define
class RegisterForm form {public function __construct ($ name = null) {parent :: __ creation ('register'); $ This- & gt; Set attribute ('method', 'post'); $ This- & gt; Set attribute ('encrypt', 'multipart / form-data'); ... $ this-- (array ('name' = & gt; 'password', 'attributes' = & gt; array ('type' = & gt; 'password',), 'options' = & gt; Array ('label' = & gt; 'password',), 'attribute' => array ('required' = & gt; 'required'), 'filter' = & gt; array (array ' = & Gt; 'StringTrim'),),));
But when it is provided in the browser, then I am receiving it when I see the page source ...
& lt; Input name = "password" required = "required" type = "text" value = "" & gt; & Lt; / Dd>
I am absolutely sure that I have received the code correctly from the book, but I am not sure if there is any other step where I accidentally overriding the RegisterForm.php file I am
Why are you override your properties? It should be:
$ this-> Array ('name' = & gt; 'password', 'option' = & gt; array ('label' = & gt; 'password', '' 'attributes' '> array (' type '=' & Gt; 'password', 'required' = & gt; 'required'), 'filter' => array (array ('name' = & gt; 'StringTrim'),),));
Comments
Post a Comment