Skip to content
docsv0.44.3

ControllerDependencies

The rule for a controller with collaborators: what it needs is registered, by type, in its plugin's boot(). Rod's first live run (greenhouse evidence/1071) ended in a 500 because nothing told the resident this: its controller asked for `DIContainerInterface`, nothing registers that, and the house could not build the controller the route named. The rule lived only in a comment of the skeleton's HelloPlugin. It is said by `make controller` (its answer and the class it writes) and by `implement`'s refusal — one owner, so the three cannot drift (greenhouse decisions/0541).

ControllerDependencies::guidance()

public static function guidance(string $plugin, string $controller): string

The guidance `make controller` gives: where a controller with dependencies is registered.

Parameters

Parameters of guidance()
NameTypeDescription
$pluginstringthe plugin's short class name, e.g. `Blog`
$controllerstringthe controller's short class name, e.g. `BlogController`