/** * Loads a group configuration file it has not been loaded before and * returns its options. If the group doesn't exist creates an empty one * * @param string $name Name of the configuration group to load * @return array Array of options for this group */ public function get_group($name) { if (!isset($this->groups[$name])) { $file = $this->pixie->find_file('config', $name); $this->load_group($name, $file); } return $this->groups[$name]['options']; }
/** * Sets the template to use for rendering * * @param string $name The name of the template to use * @throws \Exception If specified template is not found */ public function set_template($name) { $this->name = $name; $file = $this->pixie->find_file('views', $name, $this->_extension); if ($file == false) { throw new \Exception("View {$name} not found."); } $this->path = $file; }
/** * Get file data for current language from directory by specified name * * @param string $name Directory name * @return \SimpleXMLElement * @throws \Exception If file doesn't exist */ public function get($name) { $filePath = $this->pixie->find_file("i18n/{$name}", $this->lang, 'xml'); if (!file_exists($filePath)) { throw new \Exception("File {$filePath} doesn't exist"); } if (!array_key_exists($filePath, $this->files)) { $this->files[$name] = simplexml_load_file($filePath); } return $this->files[$name]; }