I have some html buttons I want to render with twig. This is the HTML:
<a href="/Worklog/editWorklog?worklogid={{worklog.id}}&customerid={{worklog.customerid}}"><button class="btn btn-primary">Edit worklog</button></a>
I created a method in php to return the HTML string above which I pass in with twig like this:
{{ html.editWorklogButton|raw }}
But when the button is rendered with raw it also renders {{ worklog.id }} and {{ worklog.customerid }} raw of course, losing the id's, giving me href to:
localhost/Worklog/editWorklog?worklogid={{worklog.id}}&customerid={{worklog.customerid}}
which instead should be something like:
localhost/Worklog/editWorklog?worklogid=1&customerid=2
I've checked twig documentation, but can't find anything on this. Is this simply not possible to do?
{{ dump(worklog) }}to check what values you have.html.editWorklogButton|raw- it will not interpret any of the values (you are saying you want it as is with the raw bit).