How to evaluate if steatment for non-boolean objects with Pebble?

55 Views Asked by At

In original Twig implementation the if steatment accepts also objects, for example:

{% if myObj %}

or

{% if myObj.mySubProp %}

it will be converted to boolean true if the object is non-null/non-empty.

Is there any way to do it with Pebble instead of using "empty" keyword?
I need to use an existing twig templates set and I cannot refactor the entire template.

0

There are 0 best solutions below