/** * Call \Slim\Container callable name * * @param string $method Container Name * @return mixed * @throws \BadMethodCallException */ public function __call($method, $params) { if ($this->container->has($method)) { $obj = $this->container->get($method); if (is_callable($obj)) { return call_user_func_array($obj, $params); } } throw new BadMethodCallException("Method {$method} is not a valid method"); }