Mecha CMS

Layout::get()

Return the layout content.

2.2.0Static

Layout::get($in, array $lot = []);

Example:

Route::set('foo/bar', function() {
    echo Layout::get('foo/bar', [
        'title' => 'Page Title',
        'description' => 'Page description.'
    ]);
    exit;
});

Content of .\lot\layout\foo.php, .\lot\layout\foo\bar.php or any file path defined by the Layout::set() method for the foo/bar ID:

Result:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title><?= $title; ?></title>
  </head>
  <body>
    <h1><?= $title; ?></h1>
    <p><?= $description; ?></p>
  </body>
</html>