Mecha CMS

Output buffer.

Shield::get()

Return the shield content.

2.0.02.2.0static
Shield::get($in, $fail = false, $print = true);
Shield::get($in, array $lot = [], $print = true);

Example:

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

Result:

Content of .\lot\shield\<id>\foo.php, .\lot\shield\<id>\foo\bar.php or any file path defined by the Shield::set() method for the foo/bar:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title><?php echo $lot['title']; ?></title>
  </head>
  <body>
    <h1><?php echo $lot['title']; ?></h1>
    <p><?php echo $lot['description']; ?></p>
  </body>
</html>