cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

Problem with switch and filters in php7

Open tacxou opened this issue 8 years ago • 5 comments

Hello,

In the new version (3.3) of Phalcon, the switch was brought in php7. My project is in the process of migrating from php5 to php7, so I have just encountered a problem between the switch and the default filter.

screenshot_20171230_112339

{{ myvar|default("abc") }}

tacxou avatar Dec 30 '17 10:12 tacxou

Could you please provide the code to reproduce?

sergeyklay avatar Dec 30 '17 19:12 sergeyklay

He provided, just use this code in volt.

Jurigag avatar Dec 30 '17 19:12 Jurigag

Parts of volt file :

{% for c in columns %}  
   <th data-column-id="{{c['name']}}" data-type="{{c['type']}}" data-sortable="{{c['sortable']}}" data-visible={{ c['visible']|default('true') }}>{{c['label']}}</th>
{% endfor %}

tacxou avatar Dec 31 '17 08:12 tacxou

I'll try to sort out as soon as I can (most likely after 3rd January)

sergeyklay avatar Dec 31 '17 20:12 sergeyklay

Fixed in the 3.3.x branch. Feel free to open a new issue if the problem appears again. Thank you for contributing.

sergeyklay avatar Jan 03 '18 22:01 sergeyklay