Beispiel #1
0
 /**
  *  Common widget method. Uses when we have no widgets called $name
  *  @param  [string] $name  [Name of template file]
  *  @param  [array]  $array [Array with data -> go to template]
  *  @return [string]        [Widget HTML or NULL if template doesn't exist]
  */
 public function common($name, $array)
 {
     $filename = ucfirst($name);
     if (file_exists(HOST . APPLICATION . '/Views/Parts/Widgets/' . $filename . '.php')) {
         return $this->_data[$name] = View::widget($array, $filename);
     }
     if (file_exists(HOST . APPLICATION . '/Views/Parts/' . $filename . '.php')) {
         return $this->_data[$name] = View::part($array, $filename);
     }
     return NULL;
 }