public function setView(\Slim\Views\Twig $view) { $slimFormTemplatePath = realpath(implode(DIRECTORY_SEPARATOR, array(__DIR__, '..', 'templates'))); $view->getInstance()->addExtension(new \SlimForm\Twig\Extension()); $loader = $view->getInstance()->getLoader()->addPath($slimFormTemplatePath); $this->_view = $view; return $this; }