We can include a .html file instead of .php file with Laravel 5 Blade.
By default Blade engine looks for .blade.php files, and then falls back to .php files. We can do what we want by telling Laravel's view system to also consider .html files by adding .html to the searched extensions by adding the following somewhere in our bootstrapping code:
View::addExtension('html', 'php');
In certain project, we add this to the base controller to apply globally.
class Controller extends BaseController
{
use AuthorizesRequests, AuthorizesResources, DispatchesJobs, ValidatesRequests;
function __construct() {
// tells the view finder to look for `.html` files and run
// them through the normal PHP `include` process
View::addExtension('html', 'php');
}
}
1 comment:
"I very much enjoyed this article.Nice article thanks for given this information. i hope it useful to many pepole.php jobs in hyderabad.
"
Post a Comment