Created
September 23, 2017 09:42
-
-
Save rahuldadhich/bd1450822ce561dae42c29835dbd127b to your computer and use it in GitHub Desktop.
Creating Header and Footer Templates in Codeigniter
This file contains hidden or 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 | |
// Creating Header and Footer Templates in Codeigniter | |
class Template_Loader extends CI_Loader { | |
public function template($template_name, $vars = array(), $return = FALSE) | |
{ | |
$content = $this->view('templates/header', $vars, $return); | |
$content .= $this->view($template_name, $vars, $return); | |
$content .= $this->view('templates/footer', $vars, $return); | |
if ($return) | |
{ | |
return $content; | |
} | |
} | |
// can create more template methods... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment