Example #1
0
 /**
  * Load and Binding View
  *
  * @todo Check http header Content_type to resolved respond's data accord
  *
  * @param string $view - name or path of view
  * @param array $vars - data push into view
  * @param bool $return - if true: get result to string; Else: express instant
  *
  * @return string (if $return true)
  */
 public function view($view, $vars = array(), $return = FALSE)
 {
     switch (strtolower($this->contentType)) {
         case 'json':
             $this->CI->output->set_output(json_encode($vars, true));
             break;
         case 'xml':
             // creating object of SimpleXMLElement
             $xml_data = new SimpleXMLElement('<root/>');
             // function call to convert array to xml
             array_walk_recursive($vars, array($xml_data, 'addChild'));
             //saving generated xml file;
             $xml = $xml_data->asXML();
             $this->CI->output->set_output($xml);
             break;
         default:
             return parent::view($view, $vars, $return);
             // TODO: Change the autogenerated stub
     }
 }
 public function __construct()
 {
     parent::__construct();
     $this->_ci_events_paths = array(APPPATH);
     log_message('debug', "MY_Loader Class Initialized");
 }
Example #3
0
 public function __construct()
 {
     parent::__construct();
 }