<commit_before><?php

namespace Kernel;

use \Exception;
use \Service\Debug\Debug;
use \Service\Session;
use \Routing\Router;
use \Service\XHR;

class View
{
    protected $twig;
    protected $twig_loader;

    protected static $data = [];
    protected static $instance = false;
    public static $config = false;

    public static $title = false;

    public static $functions = [];
    public static $filters = [];

    public static function getInstance()
    {
        self::$config = autoload_config();

        if (!self::$instance) {
            try {
                $controller = Router::getControllerName();

                $loader = new \Twig_Loader_Filesystem([
                    self::$config['app']['TWIG_VIEWS'],
                ]);

                $loader->addPath(self::$config['app']['TWIG_VIEWS'], 'view');
                $loader->addPath(DOC_ROOT . 'vendor/thupan/framework/Support/Templates/', 'stemplates');
                $loader->addPath(DOC_ROOT . 'app/Support/Templates/', 'templates');

                self::$instance = new \Twig_Environment($loader, [
                    'cache' => self::$config['app']['TWIG_CACHE'],
                    'auto_reload' => self::$config['app']['TWIG_AUTO_RELOAD'],
                    'autoescape' => self::$config['app']['TWIG_AUTO_ESCAPE'],
                    'debug' => self::$config['app']['DEBUG'],
                ]);

                Debug::collectorTwig(self::$instance);

                foreach (self::$functions as $key => $function) {
                    self::$instance->addFunction($function);
                }

                foreach (self::$filters as $key => $filter) {
                    self::$instance->addFilter($filter);
                }<commit_msg>corrigido problema de rota na view<commit_after><?php

namespace Kernel;

use \Exception;
use \Service\Debug\Debug;
use \Service\Session;
use \Routing\Router;
use \Service\XHR;

class View
{
    protected $twig;
    protected $twig_loader;

    protected static $data = [];
    protected static $instance = false;
    public static $config = false;

    public static $title = false;

    public static $functions = [];
    public static $filters = [];

    public static function getInstance()
    {
        self::$config = autoload_config();

        if (!self::$instance) {
            try {
                $controller = Router::getControllerName();

                $loader = new \Twig_Loader_Filesystem([
                    self::$config['app']['TWIG_VIEWS'],
                ]);

                $loader->addPath(self::$config['app']['TWIG_VIEWS'], 'view');
                $loader->addPath(__DIR__ . DS . '../Support/Templates/', 'stemplates');
                $loader->addPath(DOC_ROOT . 'app/Support/Templates/', 'templates');

                self::$instance = new \Twig_Environment($loader, [
                    'cache' => self::$config['app']['TWIG_CACHE'],
                    'auto_reload' => self::$config['app']['TWIG_AUTO_RELOAD'],
                    'autoescape' => self::$config['app']['TWIG_AUTO_ESCAPE'],
                    'debug' => self::$config['app']['DEBUG'],
                ]);

                Debug::collectorTwig(self::$instance);

                foreach (self::$functions as $key => $function) {
                    self::$instance->addFunction($function);
                }

                foreach (self::$filters as $key => $filter) {
                    self::$instance->addFilter($filter);
                }
{'fraction_non_alphanumeric': 0.15523156089193826, 'fraction_numerical': 0.0, 'mean_word_length': 2.018981880931838, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2182424', 'n_tokens_mistral': 974, 'n_tokens_neox': 942, 'n_words': 180}