Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Blade double brackets and templates not working but php echo does

Tags:

php

This works fine using php echo

    <!-- app/views/example.blade.php -->

    <p><?php echo $taylorTheVampireSlayer; ?></p>

The below code out puts the double brackets.

Seems like the blade templating system isn' working on my localhost/lampstack.

I have checked all permissions and tried the original code to

   <!-- app/views/example.blade.php -->


   <p>{{ $taylorTheVampireSlayer }}</p>
like image 280
user1136994 Avatar asked Oct 11 '25 21:10

user1136994


2 Answers

Try using these!

Blade::setContentTags('{{', '}}');      // for variables and all things Blade    
Blade::setEscapedContentTags('{{{', '}}}');     // for escaped data

Hope this helps! happy larveling :)

like image 137
Ajay Kumar Ganesh Avatar answered Oct 14 '25 16:10

Ajay Kumar Ganesh


I had the same issue and it has been solved by changing the name of the views by adding " .blade " between "name" and ".php" like Eluong said.

name.php : issues name.blade.php : solved

like image 33
Vianney Avatar answered Oct 14 '25 16:10

Vianney