Can we use the built-in PHP function inside the Twig file in Symfony

Hi Can anyone please let me know if we can use the built-in php function inside the twig.if file and not why. How can I access the built-in php function inside the twig file.

Because in the application for 100 time we need to check many conditions of the basis of the built-in php function. I tried to use the in_array () function to check for multiple vaslue selected in the multiple drop-down list, but I get the error Is_array () not defined.

Please, help

thank

+4
source share
2 answers

@DonCallisto Said, PHP . , php . , , .

?

SoC. . , twig (, , ).

. , php. twig, php. , php in_array,

:

php twig?

, @DonCallisto. . , . , , php builtin , Extension. php- php _. , in_array, php_in_array().

!

+2

Twig php, . , in_array() php - in twig.

- ,

+1

Source: https://habr.com/ru/post/1534005/


All Articles