public function render($file, $vars = null) 
    {
        $template = '';

        if (is_null($this->templatesPath)) {
            throw new \LogicException('Variable "templatesPath" can\'t be NULL.');
        } else if (is_string($this->templatesPath) && !file_exists($this->templatesPath)) {
            throw new \LogicException(sprintf('Folder "%s" don\'t exists.', $this->templatesPath));
        } else if (is_array($this->templatesPath)) {
            foreach ($this->templatesPath as $folderPath) {
                if (file_exists($template = "$folderPath/{$file}")) {
                    break;
                }
            }
        }
        
        if (!$template) {
            $template = "$this->templatesPath/{$file}";
        }
        
        if(!file_exists($template)){
           throw new \LogicException(sprintf('View "%s" don\'t exists.', $template));
        }
        
        if (is_array($vars)) {
            extract($vars);
            foreach ($vars as $key => $value) {
                $key = $value;
            }
        }        
        
        ob_start();
        require $template;
        return ob_get_clean();
    }