Heratio Framework API Reference

ServiceProvider
in package

AbstractYes

Base class for plugin service providers.

Optional — existing plugins continue using sfPluginConfiguration unchanged. New plugins can extend this class to register services, routes, and modules using the modern Heratio container/router instead of Symfony events.

Convention: plugins place config/provider.php returning the FQCN:

Table of Contents

Methods

__construct()  : mixed
boot()  : void
Called after ALL providers have been registered.
getName()  : string
Get the plugin name.
getRootDir()  : string
Get the plugin root directory.
modules()  : array<string|int, string>
Return array of enabled module names.
register()  : void
Register services/bindings into the container.
routes()  : void
Declare routes on the Laravel Router.

Methods

__construct()

public __construct(string $rootDir, string $name) : mixed
Parameters
$rootDir : string
$name : string

boot()

Called after ALL providers have been registered.

public boot(Container $container) : void

Use this for setup that depends on other providers' services.

Parameters
$container : Container

getName()

Get the plugin name.

public getName() : string
Return values
string

getRootDir()

Get the plugin root directory.

public getRootDir() : string
Return values
string

modules()

Return array of enabled module names.

public modules() : array<string|int, string>

These are merged into sf_enabled_modules for backward compatibility with templates that check module availability.

Return values
array<string|int, string>

register()

Register services/bindings into the container.

public register(Container $container) : void

Called once during kernel boot for each provider.

Parameters
$container : Container

routes()

Declare routes on the Laravel Router.

public routes(Router $router) : void

Called after boot() — all services are available.

Parameters
$router : Router

        
On this page

Search results