Created
November 5, 2008 13:12
-
-
Save caironoleto/22328 to your computer and use it in GitHub Desktop.
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 if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
class MY_Loader extends CI_Loader { | |
public $layout = "application"; | |
function MY_Loader() { | |
parent::CI_Loader(); | |
} | |
function setLayout($layout) { | |
$this->layout = $layout; | |
} | |
public function view($view, $data = null, $return = false) { | |
if ($this->layout == 'none') | |
$this->partial($view, $data, $return); | |
else { | |
$resultData['layoutContent'] = parent::view($view, $data, true); | |
return parent::view('layouts/' . $this->layout, $resultData, $return); | |
} | |
} | |
public function partial($view, $data = null, $return = false) { | |
return parent::view($view, $data, $return); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment