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

Volt problem with interpreting url_field() function #13447

Closed
sera527 opened this issue Jul 20, 2018 · 8 comments
Closed

Volt problem with interpreting url_field() function #13447

sera527 opened this issue Jul 20, 2018 · 8 comments
Labels
bug A bug report status: low Low
Milestone

Comments

@sera527
Copy link

sera527 commented Jul 20, 2018

I think Volt misinterprets the function url_field()

Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')' in /var/www/html/apps/cache/_var_www_html_apps_frontend_views_client_edit.volt.php on line 131

Provide minimal script to reproduce the issue

{{ url_field("facebook","id": "facebook","class":"form-control") }}

interpreted as

<?= $this->tag->urlField('facebook', 'id' => 'facebook', 'class' => 'form-control') ?>

Details

  • Phalcon version: 3.4.0
  • PHP Version: 7.1.19
  • Operating System: Lubuntu 16.04
  • Installation type: installing via package manager
  • Server: Apache
@Jurigag
Copy link
Contributor

Jurigag commented Jul 21, 2018

You forgot about array. Also github is only for NFR and bugs, for questions use forum - https://forum.phalconphp.com

@Jurigag Jurigag closed this as completed Jul 21, 2018
@sera527
Copy link
Author

sera527 commented Jul 21, 2018

@Jurigag, but the Volt documentation does not contain anything about arrays.

<label for='name'>Name</label>
{{ text_field('name', 'size': 32) }}

https://docs.phalconphp.com/ru/3.3/volt#tag-helpers

@sera527
Copy link
Author

sera527 commented Jul 21, 2018

@Jurigag also look at this.
This line

{{ tel_field("name","class":"form-control") }}

is interpreted by Volt as

<?= $this->tag->telField(['name', 'class' => 'form-control']) ?>

And this line

{{ url_field("name","class":"form-control") }}

is interpreted by Volt as

<?= $this->tag->urlField('name', 'class' => 'form-control') ?>

Why such difference? I think it's a bug.

@Jurigag
Copy link
Contributor

Jurigag commented Jul 21, 2018

https://github.com/phalcon/cphalcon/blob/master/phalcon/mvc/view/engine/volt/compiler.zep#L483 well yea you might actually be right. We need to add it there.

@Jurigag Jurigag reopened this Jul 21, 2018
@Jurigag Jurigag added this to the 3.4.1 milestone Jul 21, 2018
@frsbarbier
Copy link

I have the same error with search_field
{{ search_field('name', 'class': 'form-control') }}

Like url_field, search_field is missing in arrayHelpers https://github.com/phalcon/cphalcon/blob/master/phalcon/mvc/view/engine/volt/compiler.zep#L483

I think it's the same with

color_field
range_field
date_time_field
date_time_local_field
month_field
time_field
week_field

CameronHall added a commit to CameronHall/cphalcon that referenced this issue Oct 7, 2018
Full list of tags added are as follows;
- url_field
- color_field
- range_field
- date_time_field
- date_time_local_field
- month_field
- time_field
- week_field
CameronHall added a commit to CameronHall/cphalcon that referenced this issue Oct 7, 2018
Full list of tags added are as follows;
* url_field
* color_field
* range_field
* date_time_field
*  date_time_local_field
* month_field
* time_field
* week_field
CameronHall added a commit to CameronHall/cphalcon that referenced this issue Oct 7, 2018
Full list of tags added are as follows;
* url_field
* color_field
* range_field
* date_time_field
*  date_time_local_field
* month_field
* time_field
* week_field
CameronHall added a commit to CameronHall/cphalcon that referenced this issue Oct 7, 2018
Full list of tags added are as follows;
* url_field
* color_field
* range_field
* date_time_field
*  date_time_local_field
* month_field
* time_field
* week_field
niden added a commit that referenced this issue Oct 8, 2018
Fixes #13447: Added Volt tags to array helper in Volt Compiler
@niden
Copy link
Member

niden commented Oct 8, 2018

This has been addressed with work by @CameronHall

@niden niden closed this as completed Oct 8, 2018
@frsbarbier
Copy link

Thanks for this fix but i think search_field was forgotten in arrayHelpers.

niden added a commit that referenced this issue Oct 11, 2018
[#13447] - Added search_field in the volt compiler helpers
@niden
Copy link
Member

niden commented Oct 11, 2018

@frsbarbier I just added it. Nice catch. Thanks!

@niden niden added bug A bug report status: low Low and removed Bug - Low labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: low Low
Projects
None yet
Development

No branches or pull requests

4 participants