Adam
Adam

Reputation: 29039

Laravel debugger shows old blade template?

I have made a change to a blade template. When I enter the corresponding route in the browser I get the following error explanation:

enter image description here

The actual error message

ErrorException (E_ERROR) Undefined variable: lang (View: /home/vagrant/Code/Laravel/member/resources/views/about/benefits.blade.php)

is correct. I used an undefined variable. However, the image on the top right corner is a screen shot of an older version of the template. This has nothing to with the error. It even appears after clearing app/storage/framework/views manually or by using php artisan view:clear. Is this a bug?

Upvotes: 0

Views: 300

Answers (1)

ceejayoz
ceejayoz

Reputation: 180023

This output's a bit confusing because you're seeing the Blade template after it is compiled automatically down to raw PHP. Blade's instructions aren't PHP - PHP doesn't know what to do with it - so Laravel turns it into PHP.

So, in your template:

{{ $lang }}

gets turned into:

<?php echo e($lang); ?>

and that's what gets executed by PHP.

Upvotes: 1

Related Questions