Questions tagged as 'twig'

0
answers

How do I access a Twig variable through JavaScript?

I'm creating an autocomplete to use on my system and I'm using Twig ... My script is very simple and with some searches on the internet, that's what I got to get: <script type="text/javascript"> var nomes = {{ usuarios | json_enco...
asked by 05.04.2017 / 02:45
0
answers

Rendering the contents of an array

In the application, there is a menu that is represented in PHP in the form of an array: $menu = [ ["title" => "Home", "path" => "/home", "children" => []], ["title" => "Secção", "path" => "/seccao", "children" => [...
asked by 20.04.2016 / 20:50
0
answers

Select2 displays value instead of text

I have some fields that use Select2 to do a basic CRUD, but querying some fields from another base. The question is, when I click refresh, I put all the values in the table (dataTables) in an array, and then when I go to Select2, it does not dis...
asked by 11.11.2015 / 14:18
0
answers

Facebook pixel code with twig is giving error

I'm doing a pixel code in twig on Xtech, but the code gives an error. (It takes all the information right, but it does not work correctly.) I use the Google Chrome plugin called Facebook Pixel Helper from Facebook. I wanted you to help me...
asked by 09.12.2015 / 17:42
1
answer

Error 500 when using Slim Framework with Twig

I'm developing a simple website , with Slim Framework and Twig for engine , only returning error in the browser, this is the content of my file index.php (in the project root): require_once './vendor/autoload.php'; // Create contai...
asked by 26.11.2015 / 15:26
0
answers

How to access records from a CMS from a location above where it is installed?

I use CMS Bolt and it uses Twig , template engine. I need to access the content created on a page above where CMS is running.    Ex: Bolt installed in the blog folder; page to access and display the   content is in the tes...
asked by 29.06.2015 / 14:52
2
answers

How do I show the notification when it is missing -30 days to the expiration date

I have this condition to show the notification when the expiration date is missing 30 days, but it is not doing what I want. Anyone have a better idea? {% if entity.isExpired %} strong>Alerta!</strong>O produto com o código...
asked by 08.05.2016 / 22:53
1
answer

HTML is not showing

I have a field in my table that writes HTML-formatted text correctly. When I am trying to display it on the screen, via TWIG using the RAW filter, it continues to be displayed as text and not HTML p> I noticed that TWIG is putting a quo...
asked by 30.03.2015 / 04:29
1
answer

Insert Wordpress shortcode into a .twig file

I'm updating a site that is using twig, I need to simply put a shortcode, but the solution I have is not working, could anyone give me a light? the twig code I tried was: <div>{{post.custom_shortcode_field('[wdi_feed id="1"]')}}</div&...
asked by 08.06.2018 / 23:46
1
answer

Print a session variable through the twig engine

I entered a variable in the session named $_SESSION['ano'] . I would like to print your value on a page using twig. I've tried: {% for ano in app.session %} {{ ano }} {% endfor %} But it does not work. How can I do it? The fr...
asked by 23.01.2017 / 14:31