Normally we'll use something like
<?php
require_once 'init.php'; //file for start the session, connect to database etc.
?>
<!-- HTML Content Here-->
head body etc.
<!---------------------->
But when you're building a .blade.php template. Is thing also work that way? I mean my template is something like
<?php
require_once 'init.php';
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>@yield('title')</title>
<link rel="stylesheet" href="../public/css/bootstrap.min.css" media="screen">
<link rel="stylesheet" href="../public/css/tpl.css">
<link rel="stylesheet" href="../public/fonts/font.css">
</head>
<body>
@yield('header')
@yield('content')
@yield('footer')
</body>
</html>
Is this a best practice or is there a better way to do this?