CodeIgniter Forums
C.I. 1.6 Some config files don't load - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: C.I. 1.6 Some config files don't load (/showthread.php?tid=5609)



C.I. 1.6 Some config files don't load - El Forum - 01-28-2008

[eluser]Muser[/eluser]
I am using CI 1.6 extracted from SVN and I hope it is one of my errors.... but I've created this config file:

firstpagetypes.php

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

$firstpagetypes = array(

    //Type                    //Number of items    //Description
    'onewideonetiny' =>    array(2,    'Una gran i una petita'),

    'threetinyswithphoto' => array(3,    'Tres petites amb foto'),

    'threetinys' =>    array(3,    'Tres petites sense foto'),

    'onepanoramic' => array(1,    'Una gran panorĂ mica')        

);
?>

in my controller I have:

Code:
$bloctypesconfig = $this->config->load("firstpagetypes");

and CI error message prompt in my face:

"An Error Was Encountered

Your firstpagetypes.php file does not appear to contain a valid configuration array."

I've tried with smileys.php (CI's out of the box smilies.php) and I get the same error:

Code:
$this->config->load("smileys");

"An Error Was Encountered

Your smileys.php file does not appear to contain a valid configuration array."


It's a bug??


C.I. 1.6 Some config files don't load - El Forum - 01-28-2008

[eluser]Derek Allard[/eluser]
config files support single dimension arrays. You'd need to
Code:
$config['onewideonetiny'] ='Una gran i una petita';
$config['threetinyswithphoto'] = 'Tres petites amb foto';

etc.


C.I. 1.6 Some config files don't load - El Forum - 01-29-2008

[eluser]Muser[/eluser]
My apologise...

I've seen before the array structure of smileys.php config:

Code:
$smileys = array(

//    smiley            image name                        width    height    alt

    ':-)'            =>    array('grin.gif',            '19',    '19',    'grin'),
    ':lol:'            =>    array('lol.gif',            '19',    '19',    'LOL'),
    ':cheese:'        =>    array('cheese.gif',            '19',    '19',    'cheese'),
    ':)'            =>    array('smile.gif',            '19',    '19',    'smile'),
    ';-)'            =>    array('wink.gif',            '19',    '19',    'wink'),

... etc

and I've got confused

Thanks Derek!!


C.I. 1.6 Some config files don't load - El Forum - 01-29-2008

[eluser]Derek Allard[/eluser]
No problem at all, and my pleasure.

Welcome to CI Muser!
Derek