Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email_field() Volt function doesn't work properly in case of a placeholder parameter #1723

Closed
dedalozzo opened this issue Dec 20, 2013 · 5 comments

Comments

@dedalozzo
Copy link
Contributor

Since there is a problem with the Tag::emailField. I'm a Volt template there is a simple login form using the helpers email_field and password_field.

<form action="{{ baseUri }}/accedi/" id="signinform" name="signinform" method="post" role="form">
  {{ email_field("email", "placeholder": "E-mail") }}
  {{ password_field("password", "placeholder": "Password") }}
  <button type="submit" name="signin" class="btn blue">Accedi</button>
</form>

In the compiled template version you can see clearly that the password_field tag is properly converted, instead the email_field is not. I'm using the 1.2.4 version, I have checked the C code of tag.c and I can't see any difference between the email and the password tags, but the generated PHP is different. I think the problem is located in the Volt engine code. The email_field produces an invalid syntax and the template doesn't work. See below:

<form action="<?php echo $baseUri; ?>/accedi/" id="signinform" name="signinform" method="post" role="form">
  <?php echo $this->tag->emailField('email', 'placeholder' => 'E-mail'); ?>
  <?php echo $this->tag->passwordField(array('password', 'placeholder' => 'Password')); ?>
  <button type="submit" name="signin" class="btn blue">Accedi</button>
</form>

The only way it works is using a different syntax for email_field, putting the parameters between brackets, like follows:


{{ email_field(["email", "placeholder": "E-mail"]) }}
@phalcon
Copy link
Collaborator

phalcon commented Dec 27, 2013

Fixed in 1.2.5

@dev-denner
Copy link

In version 2.0 is happening the same thing.

@andresgutierrez
Copy link
Contributor

@denners777 This is fixed in 2.0.1

@dev-denner
Copy link

I just upgraded from version 2.0.0 to 2.0.1 and continues accusing error. I'm using dll version.

@andresgutierrez
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants