In my laravel app I want end users to be able to customize some email content and some page content.
So in my SaaS product they can customize the welcome email, or the page once someone joins the platform.
I am currently just providing them a few placeholders to use; ie
Hello $FirstName$,
and then in my code I simply do
$content = str_replace(['$FirstName$', '....'...
That why I know they are not going to add any php or anything. However, I need to do an if statement, and loop an object so I have hit the limits of my str_replace methods.
I can't use blade because that allows them to use <?php
so they could then mess with the app.
Twig sounds like it could be a good fit.
So;
- Users edit content and that is saved to the database.
- I would pass a couple of objects which had values they can use
- Safe and secure; not be able to call php / break out of the template
- Loop and check things with IF statements.
Is there something like that?