controller() публичный Метод

Create a new Controller object
public controller ( string $viewName, array $config = [] ) : Controller
$viewName string The name of the view we're getting a Controller for.
$config array Optional MVC configuration values for the Controller object.
Результат FOF30\Controller\Controller
Пример #1
0
 /**
  * Create a new Controller object
  *
  * @param   string  $viewName  The name of the view we're getting a Controller for.
  * @param   array   $config    Optional MVC configuration values for the Controller object.
  *
  * @return  Controller
  */
 public function controller($viewName, array $config = array())
 {
     try {
         return parent::controller($viewName, $config);
     } catch (ControllerNotFound $e) {
         $magic = new Magic\ControllerFactory($this->container);
         return $magic->make($viewName, $config);
     }
 }
Пример #2
0
 /**
  * Create a new Controller object
  *
  * @param   string  $viewName  The name of the view we're getting a Controller for.
  * @param   array   $config    Optional MVC configuration values for the Controller object.
  *
  * @return  Controller
  */
 public function controller($viewName, array $config = array())
 {
     try {
         return parent::controller($viewName, $config);
     } catch (ControllerNotFound $e) {
     }
     $controllerClass = $this->container->getNamespacePrefix('inverse') . 'Controller\\' . ucfirst($viewName);
     try {
         return $this->createController($controllerClass, $config);
     } catch (ControllerNotFound $e) {
     }
     $controllerClass = $this->container->getNamespacePrefix('inverse') . 'Controller\\' . ucfirst($this->container->inflector->singularize($viewName));
     return $this->createController($controllerClass, $config);
 }