Example #1
0
 /**
  * Merge all of the configuration files in this group.
  *
  * @param   string  group name
  * @param   array   configuration array
  * @return  $this   clone of the current object
  */
 public function load($group, array $config = NULL)
 {
     if (($files = Ko::findFile($this->_directory, $group)) !== FALSE) {
         $config = array();
         foreach ($files as $file) {
             $config = Arr::merge($config, require $file);
         }
     }
     return parent::load($group, $config);
 }
Example #2
0
 /**
  * Captures the output that is generated when a view is included.
  * The view data will be extracted to make local variables. This method
  * is static to prevent object scope resolution.
  *
  * @param   string  filename
  * @return  string
  */
 public function capture($filename = NULL, $display = FALSE)
 {
     if ($filename !== NULL) {
         $this->setView($filename);
     }
     if (empty($this->_file)) {
         throw new Exception('You must set the file to use within your view before rendering');
     }
     // Check && get the file's realpath
     $type = Ko::config('smarty.templates_ext') or $type = 'tpl';
     if (($filepath = Ko::findFile('views', $this->_file, $type)) === FALSE) {
         throw new KoException('The requested view :file could not be found', array(':file' => $this->_file . '.' . $type));
     }
     return $this->_smarty->fetch($filepath, NULL, NULL, $display);
 }