Jump to content

template system not loading correctly


Recommended Posts

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.