Tiger_Routing_Overrides
@api
Tiger_Routing_Overrides — the pretty-route registry (module hook + admin override tier).
A module's feature is always reachable at its canonical MVC path — `//
` — via ZF1's built-in route, with ZERO registration. A *pretty* alias (e.g. `/docs`
-> `docs/index/docs`) is an OPTIONAL override declared here:
// in the module Bootstrap (the shipped default):
Tiger_Routing_Overrides::register('docs', [
'pattern' => 'docs', // public path prefix; the remainder becomes `slug`
'target' => 'docs/index/docs', // canonical module/controller/action
'priority' => 100, // higher = checked first when prefixes overlap
]);
The admin overrides a declaration BY NAME through the `config` DB tier — no new table, no
deploy (config-discipline: the config store, not a settings table). Any of pattern / target
/ priority / enabled can be set; the DB value wins over the module default:
tiger.routing.override.docs.pattern = "help" ; retarget the public prefix to /help
tiger.routing.override.docs.enabled = 0 ; turn the pretty route off entirely
tiger.routing.override.docs.priority = 250 ; reorder vs. another module's override
Order is honored by Tiger_Controller_Plugin_RouteOverride, which walks all() (sorted by
priority DESC) and rewrites the FIRST matching path — but ONLY when no real controller claims
it, so a module's own admin paths (/docs/admin/settings) and the reserved kernel prefixes
(/api, /auth, /admin) are never shadowed. Because the plugin controls iteration order itself,
pretty routes are immune to Zend's last-in-first-out route matching.
Priority is intentionally OPEN — a module may declare any weight (even one that outranks
core). Open is open; guardrails (band-clamping) can be added later if abuse ever shows up.
## Methods
### `register()`
```php
register($name, array $spec)
```
Declare a module's default pretty route. Called from a module Bootstrap. The admin can override it by name via config. Re-registering the same name replaces the default.
- `$name` `string` — the override's unique name
- `$spec` `array` — the declared spec (pattern/target/priority/enabled)
### `get()`
```php
get($name, $config = null)
```
The effective, resolved spec for one override (module default merged UNDER any config override), regardless of enabled state — for the admin settings screen. Null if neither a declaration nor config exists for the name.
- `$name` `string` — the override name
- `$config` `Zend_Config|null` — config to read the override tier from (defaults to the registry)
**Returns** `array{name:string,pattern:string,prefix:string,target:string,mca:array,priority:int,enabled:bool}|null`
### `all()`
```php
all($config = null)
```
All ENABLED, valid overrides, sorted by priority DESC (highest checked first). Invalid (no prefix/target) or reserved-prefix entries are dropped. This is what the plugin walks.
- `$config` `Zend_Config|null` — config to read the override tier from (defaults to the registry)
**Returns** `array`
### `clear()`
```php
clear()
```
Reset declarations (tests).