I was digging through laravel and I went through how the blade views are interpreted and what I came across was that:
This:
{{ $tenant->name }}
Translates to this:
<?php echo e($tenant->name); ?>
I don't understand what the e()
method is for? I could not find it on the php.net too so I am guessing it is a part of laravel 5 itself. But what does it do?
Laravel offers a simple view that routes to home. Loading a view in the controller is easy. You just need to add ` view (‘viewname’)` method while returning from the controller method. ` view () ` is a global helper in Laravel. In this method, you just need to pass the name of the view.
4. Share Data with all Views: If you want to be shared between all the different views in a Laravel application then you can do that by using the share method. This is a View facade method so you will need to add use Illuminate\Support\Facades\View; this line.
Laravel is an MVC based PHP framework. In MVC architecture, V stands for View. The View is data that is going to be displayed to the user on their browser and the user can interact with it. It is simply an interface provided to the user for interaction. Laravel used a powerful templating engine called Blade.
In MVC architecture, V stands for View. The View is data that is going to be displayed to the user on their browser and the user can interact with it. It is simply an interface provided to the user for interaction. Laravel used a powerful templating engine called Blade. The extension for this file used here is filename.blade.php.
from the docs:
e()
The e function runs htmlentities over the given string:
echo e('<html>foo</html>');
// <html>foo</html>
http://laravel.com/docs/5.1/helpers#method-e
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With