class View implements ExtenderInterface, LifecycleInterface

Views are PHP files that use the Laravel Blade syntax for creation of server-side generated HTML.

Flarum's core uses them for error pages, the installer, HTML emails, and the skeletons for the forum and admin sites.

Methods

namespace(string $namespace, array|string $hints)

Register a new namespace of Laravel views.

extendNamespace(string $namespace, array|string $hints)

Extend an existing namespace of Laravel views.

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

No description

void
onEnable(Container $container, Extension $extension)

No description

void
onDisable(Container $container, Extension $extension)

No description

Details

View namespace(string $namespace, array|string $hints)

Register a new namespace of Laravel views.

To create and use views in your extension, you will need to put them in a folder, and register that folder as a namespace. Views can then be used in your extension by injecting an instance of `Illuminate\Contracts\View\Factory`, and calling its `make` method. The `make` method takes the view parameter in the format NAMESPACE::VIEW_NAME. You can also pass variables into a view. For more information, see: https://laravel.com/api/8.x/Illuminate/View/Factory.html#method_make

Parameters

string $namespace
array|string $hints

Return Value

View

View extendNamespace(string $namespace, array|string $hints)

Extend an existing namespace of Laravel views.

To extend an existing namespace, you will need to put views in a folder in your extension, and register that folder under the existing namespace with this extender.

Parameters

string $namespace
array|string $hints

Return Value

View

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

Parameters

Container $container
Extension|null $extension

Return Value

void

void onEnable(Container $container, Extension $extension)

Parameters

Container $container
Extension $extension

Return Value

void

Exceptions

BindingResolutionException

void onDisable(Container $container, Extension $extension)

Parameters

Container $container
Extension $extension

Return Value

void

Exceptions

BindingResolutionException