Layout::of()

Returns the layout definition.

Table of Contents
  1. Description
  2. Example

Description

Layout::of(array $keys): ?callable|string;
Layout::of(string $key): ?callable|string;

This method returns the layout definition that was previously set by the Layout::set() method.

Example

Layout::set('header', '.\path\to\layout.php');

Layout::set('nav', static function (string $key, array $lot = []) {
    return '<nav>…</nav>';
});

test(Layout::of('header')); // Returns `'.\path\to\layout.php'`
test(Layout::of('nav')); // Returns `Closure::__set_state([ … ])`

Layout::of()

Returns the layout definition.