public function setRouter($router) { if (\
is_string($router)) { $router =
new $router();
} if (!
$router instanceof Enlight_Controller_Router
) { throw new Enlight_Exception('Invalid router class'
);
} $router->
setFront($this);
$this->router =
$router;
return $this;
} /**
* Setter method for the dispatcher. Sets the front controller instance
* automatically in the given dispatcher.
*
* @param class-string<Enlight_Controller_Dispatcher>|Enlight_Controller_Dispatcher $dispatcher
*
* @throws Enlight_Exception
*
* @return Enlight_Controller_Front
*/