Welcome Guest, Not a member yet? Register   Sign In
Trouble with 'library' object
#1

[eluser]Unknown[/eluser]
I've created a 'library' object named CssLoader and saved it in /system/application/libraries as "CssLoader.php" Anyone see what's wrong with the code below?

CssLoader.php code follows:
Code:
<?php
    class CssLoader {
        function __construct($cssFiles) {
                if ($cssFiles != NULL)    return $testing = array('Testing', '1', '2', '3');
        }
    }
?>

The controller code is:
Code:
<?php
    class Home extends Controller {
    
        public function __construct() {
            parent::Controller();
        }
        
        public function index() {
            $args = array('layout');
        $content = array();        
            $content['linkedList'] = $this->load->library('CssLoader', $args);
            $content['title'] = 'Welcome';
            $content['body'] = $this->load->view('home', '', true);
            $this->load->view('template', $content);
        }
    }
?>
#2

[eluser]Colin Williams[/eluser]
When creating library classes, only the first letter of the class name should be capitalized.




Theme © iAndrew 2016 - Forum software by © MyBB