set(self::SETTINGS, $settings); // Twig template engine $container->set(self::TWIG, function (ContainerInterface $c) { /** @var Settings $settings */ $settings = $c->get(self::SETTINGS); return Twig::create(self::TWIG_TEMPLATE_DIR, $settings->getTwigSettings()); }); // Login, registration, authentication $container->set(LoginController::class, function (ContainerInterface $c) { return new LoginController( $c->get(self::TWIG) ); }); return $container; } }