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

[eluser]weboap[/eluser]
@xtremer360
you made me doubt my self hehehe.
created a setup.php config file putted it in application/config/setup.php

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$config['defaultTemplate'] = 'peach';



in application/config/autoload.php

Code:
$autoload['config'] = array('setup');



then in the welcome controller

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');



class Welcome extends CI_Controller {
  
function __construct()
{
      parent::__construct();
  
}

public function index()
{
  
   echo $this->config->item('defaultTemplate');
                   die();
}



}



output : peach



it worked.
so either your not autoloading, do to some modification in the lib, or the file is not in the right place or misspelling of the config file name.....
or
the index defaultTemplate is used somewhere with and empty value, set after your autoload. (try to load manually the config right before the line where you need it : $this->config->load('filename'); then if needed change the index to something else ....)


.....


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