<commit_before><?php
namespace Ibsciss\Wordpress\Services;

class Template {

    public static $viewsPath = 'views';
    public static $publicPath = 'public';

    private static $viewsPathCache = array();
    private static $jsRegister = array('admin' => array(),
                                        'front' => array());
    private static $cssRegister =  array('admin' => array(),
                                        'front' => array());

    /**
     * @param $templateName string
     * @param $templatesVars array
     */
    public static function render($templateName, $templatesVars)
    {
        $templatePath = self::computePath($templateName);

        //load template
        extract($templatesVars);
        require_once $templatePath;
    }

    public static function register_js($jsFileName, $context = 'front')
    {
        self::$jsRegister[$context][$jsFileName] = $jsFileName.'.js';
    }

    public static function register_css($cssFileName, $context = 'front')
    {
        self::$cssRegister[$context][$cssFileName] = $cssFileName.'.css';
    }

    public static function register_admin_css($cssFileName)<commit_msg>[FIX] multiple instance capability for template engine<commit_after><?php
namespace Ibsciss\Wordpress\Services;

class Template {

    public static $viewsPath = 'views';
    public static $publicPath = 'public';

    private static $viewsPathCache = array();
    private static $jsRegister = array('admin' => array(),
                                        'front' => array());
    private static $cssRegister =  array('admin' => array(),
                                        'front' => array());

    /**
     * @param $templateName string
     * @param $templatesVars array
     */
    public static function render($templateName, $templatesVars)
    {
        $templatePath = self::computePath($templateName);

        //load template
        extract($templatesVars);
        require $templatePath;
    }

    public static function register_js($jsFileName, $context = 'front')
    {
        self::$jsRegister[$context][$jsFileName] = $jsFileName.'.js';
    }

    public static function register_css($cssFileName, $context = 'front')
    {
        self::$cssRegister[$context][$cssFileName] = $cssFileName.'.css';
    }

    public static function register_admin_css($cssFileName)
{'fraction_non_alphanumeric': 0.12809564474807855, 'fraction_numerical': 0.0, 'mean_word_length': 2.6325581395348836, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '917188', 'n_tokens_mistral': 595, 'n_tokens_neox': 588, 'n_words': 143}