\ < \ ?php and \ ? \ > Remove spaces
Oct 13, 2022
5
Level 2
Escaping php tags in blade for code highlighting?
I'm trying to build a blade view that will show some code for a user to copy and paste. The issue is that the code snippet contains a <?php tag, hence it's being executed.
Is there any way to tell Blade to ignore those tags?
<pre>
<code class="language-php">
<script>
window.dsSettings = {
appId: 'REPLACE WITH YOUR APP ID',
name: '<?php echo "{$user->first_name} {$user->last_name}"; ?>;',
};
</script>
</code>
</pre>
Level 51
@colinlongworth Glad to hear that, please close the discussion.
Please or to participate in this conversation.