F
F
fomenko_alexandr2017-02-03 21:25:03
PHP
fomenko_alexandr, 2017-02-03 21:25:03

How to make bb codes in twig?

Hello masters.
In general, I use twig, and I ran into one problem. That when adding data to the database, they are displayed completely without transitions to a new line. I tried to solve it this way: I extract a string from the base, and put the string processed by the nl2br function into the array, then I transfer the entire data array to twig. But it outputs just br tags as text. Here I had an urgent question, how then can I do here so that the transition is visible? And how can you write your own bb-codes and pass them to twig?
I used to do this: bb_codes(htmlspecialchars($text))
But I don’t know how it is)
I would be very grateful for your help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergej, 2017-02-03
@fomenko_alexandr

twig.sensiolabs.org/doc/2.x/filters/raw.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question