private function scoped($__filename, $__vars = array(), $__allowShortTags = false)
    {
        extract((array)$__vars);
        ob_start();
        if ($__allowShortTags && version_compare(PHP_VERSION, '5.4.0', '<') && 
            (bool) @ini_get('short_open_tag') === false) {
            // from CodeIgniter (https://github.com/EllisLab/CodeIgniter)
            eval('?>' . preg_replace("/;*\s*\?>/", "; ?>", str_replace('<?=', '<?php echo ', file_get_contents($__filename))));
        } else {
            include($__filename);
        }
        $content = ob_get_clean();
        
        // retreives "public" variables (not prefixed with an underscore)
        $vars = array();
        foreach (get_defined_vars() as $name => $value) {
            if (substr($name, 0, 1) != '_') {
                $vars[$name] = $value;
            }
        }
        
        return array($content, $vars);
    }