anh4r

template ci 3

Nov 27th, 2021
756
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. Class Template {
  4.  
  5.     var $template_data = array();
  6.  
  7.     function set($name, $value)
  8.     {
  9.         $this->template_data[$name] = $value;
  10.     }
  11.  
  12.     function load($template = '', $view = '', $view_data = array(), $return = FALSE)
  13.     {
  14.         $this->CI =& get_instance();
  15.         $this->set('contents', $this->CI->load->view($view, $view_data, TRUE));
  16.         return $this->CI->load->view($template, $this->template_data, $return);
  17.     }
  18.  
  19. }
RAW Paste Data