Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function root_require($file, $ir, $templates = FALSE){
- $path = ROOT . SLSH;
- switch($templates){
- case 'admin':
- $path .= 'templates' . SLSH . 'admin';
- break;
- case 'page':
- $path .= 'templates' . SLSH . 'page';
- break;
- default:
- $path .= 'include';
- break;
- }
- $path .= SLSH . $file;
- if (is_readable( $path )){
- switch ($ir){
- case 'i':
- include $path;
- break;
- case 'io':
- include_once $path;
- break;
- case 'ro':
- require_once $path;
- break;
- case 'r':
- default:
- require $path;
- break;
- }
- } else{
- trigger_error('Tried to include a file that does not exist: ' . $path, E_USER_NOTICE);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement