private function parse($file, $data = array(), $trigger = null)
    {
        if(is_null($data)) {
            $data = array();
        } else if(is_string($data)) {
            $trigger = $data;
            $data = array();
        }

        if($trigger) {
            eve()->trigger('template-'.$trigger, $file, $data);
        }

        $path = eve()->path('template');

        if(file_exists($path.'/'.$file.'.php')
            && static::TEMPLATE_EXTENSION !== 'php'
        ) {
            return eve('template')->set($data)->parsePHP($path.'/'.$file.'.php');
        } else if(file_exists($path.$file.'.phtml')
            && static::TEMPLATE_EXTENSION !== 'phtml'
        ) {
            return eve('template')->set($data)->parsePHP($path.'/'.$file.'.phtml');
        }

        $contents = file_get_contents($path . '/'. $file . '.' . static::TEMPLATE_EXTENSION);
        $template = $this->getEngine()->compile($contents);

        return $template($data);
    }