public function validate() { return true; // @todo create XSD models $luie = libxml_use_internal_errors(); libxml_use_internal_errors(true); /* XSD validation file -if exists- is based on file name */ $xsdFileName = substr($this->_filePath, strrpos($this->_filePath, DIRECTORY_SEPARATOR) + 1); $xsdFileName = substr($xsdFileName, 0, strpos($xsdFileName, '.')); $xsdFileName = Config\Loader::findFile('xsd/' . $xsdFileName . '.xsd'); if (is_null($xsdFileName)) { return true; } else { $doc = new \DOMDocument(); $doc->load($this->filePath); $validate = $doc->schemaValidate($xsdFileName); libxml_use_internal_errors($luie); return $validate; } }
public function loadTemplate($tpl, $module = null) { $paths = Config::getPaths(Config::REALM_TEMPLATES); if ($module) { $path = Core::$basePath . 'application/modules/' . $module . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR; if (is_dir($path)) { array_unshift($paths, $path); } } if (Core\Layout::$module) { $path = Core::$basePath . 'application/modules/' . Core\Layout::$vendor . DIRECTORY_SEPARATOR . Core\Layout::$moduleKey . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR; if (is_dir($path)) { array_unshift($paths, $path); } } $files = Config\Loader::findFile($tpl, $paths); foreach ($files[Config::DEFAULT_PREFIX] as $file) { if (file_exists($file)) { return $file; } } return false; }