Added new layout method to the loader

This commit is contained in:
alextselegidis 2021-11-09 08:39:30 +01:00
parent cd9a92bed9
commit 6d567a74a4
1 changed files with 16 additions and 1 deletions

View File

@ -40,5 +40,20 @@
* @property EA_URI $uri
*/
class EA_Loader extends CI_Loader {
//
/**
* Loads "layout" files.
*
* @param string $layout
* @param string $template
* @param array $vars An associative array of data to be extracted for use in the view
* @param bool $return Whether to return the view output or leave it to the Output class
*
* @return object|string
*/
public function layout(string $layout, string $template, array $vars = [], bool $return = FALSE)
{
$vars['template'] = APPPATH . 'views/' . $template . '.php';
return $this->view($layout, $vars, $return);
}
}