I want to implement functionality like CodeIgniter does in its loadview function - While loading the view we pass third parameter "true" so that the page will be taken as a string.
Using file_get_contents() is correct option while wrting custom mvc framework ?
I hav a function to load view as -
function loadView($directoryPath, $page, $data = array()) {
extract($data);
// construct path for loading the view
$viewURL = $GLOBALS['config']['dir-views'];
$path = $viewURL . DS . $directoryPath . DS . $page;
// actual loading of a view.
include $path;
}