public static function getEngine()
    {
        if (!static::$engine) {
            $loader = new \Twig_Loader_Filesystem();
            $loader->setPaths(__DIR__ . '/../../views');
            foreach (app('extension')->getExtensions() as $extension) {
                $path = $extension->getPath() . '/views';
                if (file_exists($path)) {
                    $loader->setPaths($path, $extension->getPackage());
                }
            }
            static::$engine = new \Twig_Environment($loader);
            static::$engine->addGlobal('assets', static::getAssetManager());
            static::$engine->addGlobal('config', Config::get());
        }
        return static::$engine;
    }