Created
January 16, 2018 20:45
-
-
Save albertomario/d7b4605e1bd80941e8b12d1b14d61e01 to your computer and use it in GitHub Desktop.
codeigniter template helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MY_Loader extends CI_Loader { | |
public function template($template_name, $vars = array(), $return = FALSE) | |
{ | |
if($return): | |
$content = $this->view('templates/header', $vars, $return); | |
$content .= $this->view($template_name, $vars, $return); | |
$content .= $this->view('templates/footer', $vars, $return); | |
return $content; | |
else: | |
$this->view('templates/header', $vars); | |
$this->view($template_name, $vars); | |
$this->view('templates/footer', $vars); | |
endif; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment