class View implements ExtenderInterface, LifecycleInterface

Methods

namespace(string $namespace, $hints)

<p>Register a new namespace of Laravel views.</p>

extend(Container $container, Extension $extension = null)

No description

onEnable(Container $container, Extension $extension)

No description

onDisable(Container $container, Extension $extension)

No description

Details

View namespace(string $namespace, $hints)

<p>Register a new namespace of Laravel views.</p>

<p>Views are php files that use the Laravel Blade syntax for creation of server-side generated html. Flarum core uses them for error pages, the installer, HTML emails, and the skeletons for the forum and admin sites. To create and use views in your extension, you will need to put them in a folder, and register that folder as a namespace.</p> <p>Views can then be used in your extension by injecting an instance of <code>Illuminate\Contracts\View\Factory</code>, and calling its <code>make</code> method. The <code>make</code> method takes the view parameter in the format NAMESPACE::VIEW_NAME. You can also pass variables into a view: for more information, see <a href="https://laravel.com/api/8.x/Illuminate/View/Factory.html#method_make">https://laravel.com/api/8.x/Illuminate/View/Factory.html#method_make</a></p>

Parameters

string $namespace
$hints

Return Value

View

extend(Container $container, Extension $extension = null)

Parameters

Container $container
Extension $extension

onEnable(Container $container, Extension $extension)

Parameters

Container $container
Extension $extension

Exceptions

BindingResolutionException

onDisable(Container $container, Extension $extension)

Parameters

Container $container
Extension $extension

Exceptions

BindingResolutionException