connector ​
File: src/Helpers/connector.php
Entrypoint helpers for the Modularous Connector system — the mechanism that links form inputs to repository actions across modules.
Functions ​
init_connector ​
init_connector(string $moduleName, string $routeName, array $config = []): mixedMain entrypoint. Resolves the module and route, then delegates to find_target and exec_target. Returns the result of the connector action.
find_module_and_route ​
find_module_and_route(string $moduleName, string $routeName): arrayLooks up the module via Modularous::find() and returns [$module, $route]. Throws if either cannot be resolved.
find_module_route_names ​
find_module_route_names(string $moduleName): arrayReturns all route names registered in a module. Uses Modularous::find($moduleName)->getRouteNames().
get_connector_event ​
get_connector_event(string $moduleName, string $routeName, string $event): mixedRetrieves the connector event configuration for a specific module/route/event combination from the module's route config.
change_connector_event ​
change_connector_event(string $moduleName, string $routeName, string $event, mixed $value): voidMutates the connector event value in the module's route config. Used during form schema build to wire input events.
find_target ​
find_target(array $config): arrayParses the connector $config to determine the target type (uri or repository) and returns a normalised descriptor array including the resolved endpoint URL or repository class name.
exec_target ​
exec_target(array $target, string $method, array $params = []): mixedExecutes the resolved target. For repository targets it calls App::make($target['repository'])->{$method}(...$params). For uri targets it returns the URL for the frontend to call.
get_item_columns ​
get_item_columns(string $moduleName, string $routeName): arrayReturns the column configuration for the items list of a connector-backed input — resolves the module's repository, calls getColumns(), and formats them for the frontend select/combobox input.