View::sandbox PHP Method

sandbox() protected method

Create sandbox for template execution
protected sandbox ( array $hive = NULL ) : string
$hive array array
return string
    protected function sandbox(array $hive = NULL)
    {
        $this->level++;
        $fw = Base::instance();
        $implicit = FALSE;
        if (is_null($hive)) {
            $implicit = TRUE;
            $hive = $fw->hive();
        }
        if ($this->level < 2 || $implicit) {
            if ($fw->get('ESCAPE')) {
                $hive = $this->esc($hive);
            }
            if (isset($hive['ALIASES'])) {
                $hive['ALIASES'] = $fw->build($hive['ALIASES']);
            }
        }
        unset($fw, $implicit);
        extract($hive);
        unset($hive);
        ob_start();
        require $this->view;
        $this->level--;
        return ob_get_clean();
    }