daylerees / anbu

Anbu profiler for the Laravel PHP Framework.
308 stars 24 forks source link

Support Laravel 5.0 Blade Syntax #20

Open mikedugan opened 10 years ago

mikedugan commented 10 years ago

For better or for worse, default blade syntax for HTML in L5 is now {!! $var !!}.

Local workaround:

Alternatively, you theoretically should be able to bind the old escaped echo delimiters to Blade using \Blade::setEscapedContentTags('{{', '}}'), but I'm having trouble getting that to work (tried it at the end of the BaseController constructor).

Great work! Can't wait to see this evolve over time!

daylerees commented 10 years ago

Thanks man. Trying to decide how to do this without breaking 4.2. Cheers for the issue!

mikedugan commented 10 years ago

Definitely. I don't see where you grab the Laravel version, but you could do a quick check on that and then set the blade syntax...or you could probably just set the syntax anyway, if it's already working it'll keep working, if it's not then it will/should.

daylerees commented 10 years ago

I could check against the version, but it might be a bit nasty that way :) I'll have a play with it mate.

mikedugan commented 10 years ago

Related: https://github.com/laravel/framework/pull/5758

If/when that is fixed, it should be trivial to set Blade to use the 4.* syntax

foxted commented 10 years ago

Is it possible to create two versions of the package? One for 4.2 and the other one for 5.0?

mikedugan commented 10 years ago

It shouldn't be necessary (to maintain separate versions) once the issue with quoted tags mentioned above is resolved. Once that's done, it can be set via Blade::setRawTags('{{', '}}')

tyloo commented 9 years ago

a quick way would be a new "develop" branch for Laravel 5 and the master with 4.2 ;)