Library not working |
I tried to implement a library which allows me to display global data like site name, site logo, etc from the database to all the views without the necessity of passing them via controllers(which I think is time consuming).
PHP Code: <?php now in order to put it in my views, I've gotten to do just this: PHP Code: <?php echo $settings['website_name'] ?> This is what I get, two errors, one for the undefined property: Quote:Severity: Notice and one for the function calling in null(is there a way to overwrite this?): Quote:An uncaught Exception was encountered I hope I could make myself clear. Thanks in advance.
I do Front-End development most of the time
Your missing self or $this on your $settings array
PHP Code: // Wrong Also I think I ran into this with my Registry Class and had to make a helper with methods to access the library methods. So if that does not work then you will need to create a helper for the library. Download registry here: Registry for CodeIgniter What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(03-21-2018, 04:07 AM)InsiteFX Wrote: Your missing self or $this on your $settings array Yes, you were right!. Thanks!
I do Front-End development most of the time
|
Welcome Guest, Not a member yet? Register Sign In |