Questions tagged [Twig] (189)

1
answer

Symfony — how can I display the difference between two strings?

Hi All, is it possible to display the difference between the two lines? what bundle or there is a feature filter for Twig? tobish otobrazit diff string, well in Bitbucket...
craig39 asked April 19th 20 at 12:28
0
answer

Is there extended documentation for Twig?

Is there extended documentation for Twig? For https://twig.symfony.com/doc/3.x/templates.html and https://dev-gang.ru/doc/twig/ infa thin, but scarce.
Hugh.Kr asked April 18th 20 at 13:00
1
answer

How to add a variable to a specific twig template 1.*?

Twig 1.* used as a standalone library (not part of symfony or similar). There is a certain pattern that is connected to the other templates. This pattern requires several variables. How do I specify them once instead of passing every time from the controller? I guess the examples would be clearer. For those who are famili...
Armando.Walt asked April 16th 20 at 11:11
1
answer

How do I output a nested array in twig?

Trying to get a nested array in twig Here is the array array(4) { ["03f2d305-35fd-4cf0-8c77-659a8484d844"]=> array(5) { ["id"]=> string(36) "03f2d305-35fd-4cf0-8c77-659a8484d844" [title]=> string(6) "Test 3" ["slug"]=> string(6) "Test 3" ["parent_id"]=> NULL ["children"]=> arr...
Oma_DuBuq asked April 9th 20 at 10:30
0
answer

How to set the Twig in Webpack?

Hello, assembles project webpage hooked up to it twig loader and twig-html-loader. The build configuration is the following: const path = require('path'); const HTMLWebpackPlugin = require('html-webpack-plugin'); const {CleanWebpackPlugin} = require('clean-webpack-plugin'); const resolvePath = place => { return path....
Jaleel_Connelly63 asked April 9th 20 at 09:38
0
answer

How to start working with TWIG?

Guys, explain how to start working with Twigg? Access to the console not set to manual. The downloaded version of twig 3.x hub, leaf through the user manual in the ass-forward, looked 2 launch video tigom. I realized one thing, the instructions and videos included php files autoloader or autoload. I have the same archive wi...
Hildegard_Corkery6 asked April 8th 20 at 17:53
1
answer

Is there a way to decompose an array into variables in Twig template?

Is it possible to do something like in PHP, the array is decomposed into variables in Twig? $info = array('coffee', 'brown', 'caffeine'); list($drink, $color, $power) = $info; My Twig template (field in ACF, can anyone knows how to do better): {% for photo in tour.get_field('photos') %} {% set photo = photo.photo %} {% i...
izaiah.Gutkowski asked April 8th 20 at 09:35
1
answer

How to count the number of positive reviews?

Hello! There is a list of reviews which may contain or not contain positive comments. Question: How to deduce the number of reviews that contain positive comments? {% for item in ReviewComponent.reviews.items %} {% if item.attributes.page_casino == record.slug %} {% component 'ReviewComponent' %} {{ dump(item.positive)}...
Jaida34 asked April 8th 20 at 02:18
0
answer

The output of the form in twig, Drupal 8?

Trying to get a custom form module in template engine twig WebinarForm.php <?php namespace Drupal\webinar_form\Form; use Drupal\Core\Form\FormBase; // Base class Form API use Drupal\Core\Form\FormStateInterface; // Class responsible for processing data /** * Inherited from base class Form API * @see \Drupal\Core\For...
Jordan67 asked April 8th 20 at 02:02
0
answer

Uncaught error Twig_Error_Syntax: Unknown "str_replace" function in?

how to fix the error? Uncaught Twig_Error_Syntax: Unknown "str_replace" function in string urlCartLoadData = {{ "\"" ~ str_replace('&', '&', urlCartLoadData) ~ "\"" }};
Kayla asked April 7th 20 at 16:39