Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twig: how to write if in_array

Tags:

I have the following php statement:

<?php if(in_array(get_theme_mod('navbar_position'), array('under-header', 'bottom-of-header'))) { ?>

I'd like to convert it for use with Twig (I'm using twig to build a wordpress theme), I have found this code snippet but not too sure how to adapt it for what I need:

{% if myVar in someOtherArray|keys %}

Would it be something like this:

{% if theme.theme_mod('navbar_position') in 'under-header', 'bottom-of-header'|keys %}

...a bit of a stab in the dark.