Skip to content

Instantly share code, notes, and snippets.

@cj
Created December 30, 2010 17:51
Show Gist options
  • Save cj/760045 to your computer and use it in GitHub Desktop.
Save cj/760045 to your computer and use it in GitHub Desktop.
if ( ! function_exists('render_view'))
{
function render_view($view, $data= array())
{
$ar_view= explode('/', $view);
$dir= array_shift($ar_view);
$previous_dir= $GLOBALS['d'];
$view= implode('/', $ar_view);
$GLOBALS['d']= $dir;
$body= view($view, $data);
$GLOBALS['d']= $previous_dir;
return $body;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment