Welcome Guest, Not a member yet? Register   Sign In
WOrking with custom config files
#1

[eluser]xtremer360[/eluser]
I'm trying to figure out why this won't work. I created my own custom config file and autoloaded it and for some reason isn't getting the value of the config index I'm looking for.

I'm getting an error message that says:

Unable to load the requested file: template//cpanel/index.php

So if you notice its missing a value in between two slashes.

Code:
$config['defaultTemplate'] = 'peach';
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Dashboard 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 =  '';//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 = 'template/'. $this->config->item('defaultTemplate') ."/cpanel/dashboard";//which view file
  $bodyType = "full";//type of template  
  echo $this->config->item('defaultTemplate');
  
  
  

  /***********************************************************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->load->view('template/'. $this->config->item('defaultTemplate') .'/cpanel/index', $this->data);
}
    
    function submit()
    {
        
    }
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */


Messages In This Thread
WOrking with custom config files - by El Forum - 05-10-2012, 08:44 PM
WOrking with custom config files - by El Forum - 05-10-2012, 09:11 PM
WOrking with custom config files - by El Forum - 05-10-2012, 09:22 PM
WOrking with custom config files - by El Forum - 05-10-2012, 09:31 PM
WOrking with custom config files - by El Forum - 05-10-2012, 11:32 PM
WOrking with custom config files - by El Forum - 05-11-2012, 09:10 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:32 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:34 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:36 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:41 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:46 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:53 AM
WOrking with custom config files - by El Forum - 05-11-2012, 09:59 AM
WOrking with custom config files - by El Forum - 05-11-2012, 10:19 AM
WOrking with custom config files - by El Forum - 05-11-2012, 10:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB