Skip to content
docsv0.34.0

RoutesComponent

The Routes section as a Milpa Component: its state is the table of every declared route. Method, path, name, handler, per-route middleware and the declaring plugin — the whole declaration, read-only. Declaring routes is a plugin's job (`RouteProviderInterface`); the panel shows what was declared and by whom.

RoutesComponent::__construct()

public function __construct(Milpa\Admin\Data\RoutesSource $source):

Parameters

Parameters of __construct()
NameTypeDescription
$sourceMilpa\Admin\Data\RoutesSource

RoutesComponent::contract()

public static function contract(): Milpa\Live\ValueObjects\ComponentContract

The contract: no props, a read-only state, no actions.

RoutesComponent::mount()

public function mount(array $props, Milpa\Live\ValueObjects\ComponentContext $context): Milpa\Live\ValueObjects\StateSnapshot

Mounts with the routes the booted plugins declare right now.

Parameters

Parameters of mount()
NameTypeDescription
$propsarray
$contextMilpa\Live\ValueObjects\ComponentContext

RoutesComponent::handle()

public function handle(Milpa\Live\ValueObjects\InteractionRequest $request): Milpa\Live\ValueObjects\InteractionResult

Refuses every action: the section is read-only.

Parameters

Parameters of handle()
NameTypeDescription
$requestMilpa\Live\ValueObjects\InteractionRequest