Welcome Guest, Not a member yet? Register   Sign In
C.I. 1.6 Some config files don't load
#1

[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??
#2

[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.
#3

[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!!
#4

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

Welcome to CI Muser!
Derek




Theme © iAndrew 2016 - Forum software by © MyBB