• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why doesn't this library load in my controller?

This is the file "stylesheet.php", which is in the subfolder "utilities" in my "controllers" folder.


class Stylesheet extends Controller

    function Stylesheet()
    function foo()


When I go to index.php/utilities/stylesheet/foo I get the error:

Quote:Fatal error: Undefined property: Stylesheet::$CSS. Call to a member function select() on a non-object in C:\Server\Frameworks\CodeIgniter\application\controllers\utilities\stylesheet.php

The "CSS" library is a custom library in my application's "libraries" folder. Its contents are:

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

class CSS {

    function select($element)



So as you can see, I am trying to load a custom library which contains the function "select" - but although I get no error message for the loading of the library, calling this select method just doesn't work!

Please help! Thanks.

It's because you use upper case in the CSS library name. Call it css and it will be OK.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.