class Theme
{
function __construct()
{
}
function load( $folder, $file )
{
$theme_path = ROOTPATH . '/theme/' . $folder . '/' . $file . '.php';
require_once($theme_path);
return TRUE;
}
}
on index.php
<?php
require class.theme.php
$theme = new Theme;
$theme->load('site','index');
?>
on my site/index.php
<?php
// to work i need another $theme = new theme; why can i do this ? can i make
it make it work twice or more inside the function load ?
$theme->load('site','header');
$theme->load('site','footer');
?>
somehow it needs to $theme = new Theme; again on site/index.php
is there another way to make it work? maybe my class design is not good or algorithm is failing.
edit* more information ok so what im trying to do is to load header view footer view.
Thanks Adam Ramadhan