10 defined(
'JPATH_PLATFORM') or die;
57 $this->input = ($input === null) ? $this->app->input : $input;
71 public function execute($route)
74 $name = $this->parseRoute($route);
77 $controller = $this->fetchController($name);
80 return $controller->execute();
92 public function setControllerPrefix($prefix)
94 $this->controllerPrefix = (string) $prefix;
108 public function setDefaultController($name)
110 $this->
default = (string) $name;
125 abstract protected function parseRoute($route);
137 protected function fetchController($name)
140 $class = $this->controllerPrefix . ucfirst($name);
143 if (!class_exists($class) || !is_subclass_of($class,
'JController'))
145 throw new RuntimeException(sprintf(
'Unable to locate controller `%s`.', $class), 404);
149 $controller =
new $class($this->input, $this->app);