-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsupported use of @php directive #2012
Comments
Hi @collegeman, It looks like the issue template is missing from this issue. Please take a look at the Contribution Guidelines, which will tell you exactly what your ticket has to contain in order to be processable. Please do not use the issue tracker for personal support requests (use the Roots Discourse to ask the Roots Community for help, or if you want the Roots Team to dedicate some time to your issue, we offer our services as well). |
@roots-ladybug spanked me! 🐞 |
Also if you're using vscode and the Laravel Blade Snippets extension, emmet won't recognize anything after a @php() directive as "blade". Therefore snippets won't work and syntax highlighting is funny, for example comment syntax will be like That's why I changed all the @php() directives to @php @endphp tags. |
Dear amazing people at Roots;
I want to draw your attention to this issue I reported in the Laravel project. It seems using the
@php
directive in what I've been calling the "single-tag-form" is no longer supported. The reason being that if there are any@endphp
closing tags used in the same template, all of the content between the first@php
and the last@endphp
will be evaluated by the compiler to be of the same directive, resulting in unintended behavior, e.g., the intervening template code being printed to the screen.Here's an example of the way you're using it:
sage/resources/views/layouts/app.blade.php
Line 2 in 42db9f9
This way that you're using the
@php
directive is functional, but only in isolation to the block-form that includes both the@php
and@endphp
tags.The text was updated successfully, but these errors were encountered: