Example #1
0
 /**
  * construct and set some variables for the helper
  * @param string(optional unlimited args), file and or folder structure for the desired html file
  * @uses new Hueco\ViewHelper() 
  * @uses new Hueco\ViewHelper( Hueco\Router::$action ) an elegant manner to make a route link between actions and views
  * @uses new Hueco\ViewHelper( 'Admin', Hueco\Router::$action ) if your app requested action is inside a folder structure
  * @todo take a better care of the header content-type
  */
 function __construct()
 {
     $action = join(DS, func_get_args());
     if ($action) {
         // if
         if ($action[0] == DS) {
             $action[0] = '';
         }
         $this->view($action);
     }
     // set the host
     $this->_host = Router::getBaseHost();
     if (substr($this->_host, -1) != DS) {
         $this->_host .= DS;
     }
     // is it really necessary? I wonder....
     return header('Content-Type: text/html; charset=utf-8');
 }