How to display text from mySql in twig with specefic format?

I have a site which contains articles and posts every article has a specefic format like subtitles are bold and red titles have big font-weight and blue …etc . The problem is that i don’t have admin page so i am putting these posts directly in mySql db and i am recupering these articles from the DB so i can’t generate the format of each article in Twig . The solution i am using now is including html tags and css style in my database and using “nl2br” in twig to display every article with its format but i think there is a better solution because other people want to publish articles too and they don’t master html .

if anyone could help me i’ll be thankful 🙂

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *