Cristobal Nyram
Cristobal Nyram

Reputation: 1

How Can I use operator ternary in phalcon version 3.4 in volt?

I would like to use the phalcon ternary operator provided by version 3.4, but I would like to use it with the one validation at the same time.

{% set pageType = 'basicSetting' %} {{ pageType == 'basicSetting' ? 'class="active"' : '' }}

The above example is from here

Upvotes: 0

Views: 110

Answers (1)

Cristobal Nyram
Cristobal Nyram

Reputation: 1

After some research and analysis, I was able to find this,it is a little example

{% set result_that_you_want = (value==1) ? 'the result is 1' : 'the result is not the same the 1' %}

Upvotes: 0

Related Questions