Xtremer360 Posted May 7, 2012 Share Posted May 7, 2012 I'm trying to figure out why I'm getting a Unable to load the requested file: peach/header.php <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Login extends CI_Controller { public function index() { //Config Defaults Start $msgBoxMsgs = array();//msgType = dl, info, warn, note, msg $cssPageAddons = '';//If you have extra CSS for this view append it here $jsPageAddons = '<script type="text/javascript" src="'.base_url().'assets/zice/js/logincheck.js"></script><script type="text/javascript" src="'.base_url().'assets/zice/js/login.js"></script>';//If you have extra JS for this view append it here $metaAddons = '';//Sometimes there is a need for additional Meta Data such in the case of Facebook addon's $siteTitle = '';//alter only if you need something other than the default for this view. //Config Defaults Start //examples of how to use the message box system (css not included). //$msgBoxMsgs[] = array('msgType' => 'dl', 'theMsg' => 'This is a Blank Message Box...'); /**********************************************************Your Coding Logic Here, Start*/ $bodyContent = "zice/forms/login_form";//which view file $bodyType = "full";//type of template $templateVar = 'zice'; /***********************************************************Your Coding Logic Here, End*/ //Double checks if any default variables have been changed, Start. //If msgBoxMsgs array has anything in it, if so displays it in view, else does nothing. if(count($msgBoxMsgs) !== 0) { $msgBoxes = $this->msgboxes->buildMsgBoxesOutput(array('display' => 'show', 'msgs' =>$msgBoxMsgs)); } else { $msgBoxes = array('display' => 'none'); } if($siteTitle == '') { $siteTitle = $this->metatags->SiteTitle(); //reads } //Double checks if any default variables have been changed, End. $this->data['msgBoxes'] = $msgBoxes; $this->data['cssPageAddons'] = $cssPageAddons;//if there is any additional CSS to add from above Variable this will send it to the view. $this->data['jsPageAddons'] = $jsPageAddons;//if there is any addictional JS to add from the above variable this will send it to the view. $this->data['siteTitle'] = $siteTitle;//defaults can be changed via models/metatags.php $this->data['bodyType'] = $bodyType; $this->data['bodyContent'] = $bodyContent; $this->data['templateVar'] = $templateVar; $this->load->view('template/index', $this->data); } function submit() { } } /* End of file welcome.php */ /* Location: ./application/controllers/welcome.php */ File structure: views/template/peach/header.php views/template/index.php Quote Link to comment https://forums.phpfreaks.com/topic/262220-template-system-not-loading-correctly/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.