Skip to content

Instantly share code, notes, and snippets.

@aambrozkiewicz
Created April 21, 2011 18:54
Show Gist options
  • Save aambrozkiewicz/935229 to your computer and use it in GitHub Desktop.
Save aambrozkiewicz/935229 to your computer and use it in GitHub Desktop.
CodeIgniter MY_Loader, displays used template before actual output in HTML comment
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Loader extends CI_Loader
{
function view($view, $vars = array(), $return = FALSE)
{
if ($return != TRUE)
echo "<!-- $view -->\n";
return ($return == TRUE ? "<!-- $view -->\n" : '') . $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment