Cphalcon: Syntax error, unexpected token IS in Volt

Created on 17 Apr 2016  路  6Comments  路  Source: phalcon/cphalcon

When i use a is() function in Volt, like that:

{% if mobileDetect.is('Chrome') %} {% endif %}

I guess, is word conflicting with Volt and i get following error:

Syntax error, unexpected token IS in themes/default/views/index/index.volt on line 78

Than tried isMobile function that is word contains, but this is working, no errors:

{% if mobileDetect.isMobile() %}
bug low

All 6 comments

Not a bug, is _is_ a reserved word. https://docs.phalconphp.com/en/latest/reference/volt.html#other-operators

@JCMais i know that is reserved. But could be override or ignore like that \is.

$is ?

@sergeyklay I tried like your said as following:

{% if !mobileDetect.$is('Chrome') %}

Getting that error:

Scanning error before 'is('Chrome') %} ...' in themes/default/views/index/index.volt on line 78

Even if "is" is a reserved word it should be ignored when called like a method. So a Bug to me

Was this page helpful?
0 / 5 - 0 ratings