Welcome Guest, Not a member yet? Register   Sign In
Autoloading library methods?
#11

[eluser]Wayne Smallman[/eluser]
[quote author="Phil Sturgeon" date="1296508549"]If you give me some examples perhaps I could give you a more accurate answer.

This will not make something run on EVERY controller, only those that extend a type of base controller. By giving your controllers types you specify what sort of functions should be run by default.

Admin_Controller extends MY_Controller
Public_Controller extends MY_Controller
AJAX_Controller extends MY_Controller
WHYWSIWYG_Controller extends Admin_Controller

You can create all sorts of combination's for the various types of functionality parts of your site needs.[/quote]OK, I've got a basic messaging system that informs users that someone has commented on a relationship, which is a collection of bookmarks.

I want an appropriate number to appear next to the "Messages" navigation item, informing the user how many messages they have that are unread.

This is just one example, but as the application develops, there will be countless others.

I'm using the simplest "MY_Controller" method, which extends the core controller and all my controllers then look to the new "MY_Controller". Within that controller, I'll place all of my functions which I want to load automatically.

So far, I can't do that, and the only way I can get any of this to work is to add the code into the constructor for each controller, which is pointless, as I could have just as easily accomplished all of this without messing around adding an middle man of a controller.

Any ideas?


Messages In This Thread
Autoloading library methods? - by El Forum - 01-31-2011, 04:21 AM
Autoloading library methods? - by El Forum - 01-31-2011, 06:45 AM
Autoloading library methods? - by El Forum - 01-31-2011, 06:53 AM
Autoloading library methods? - by El Forum - 01-31-2011, 07:18 AM
Autoloading library methods? - by El Forum - 01-31-2011, 07:42 AM
Autoloading library methods? - by El Forum - 01-31-2011, 07:59 AM
Autoloading library methods? - by El Forum - 01-31-2011, 08:07 AM
Autoloading library methods? - by El Forum - 01-31-2011, 08:11 AM
Autoloading library methods? - by El Forum - 01-31-2011, 09:13 AM
Autoloading library methods? - by El Forum - 01-31-2011, 09:15 AM
Autoloading library methods? - by El Forum - 01-31-2011, 09:23 AM
Autoloading library methods? - by El Forum - 01-31-2011, 09:52 AM
Autoloading library methods? - by El Forum - 01-31-2011, 10:04 AM
Autoloading library methods? - by El Forum - 01-31-2011, 11:47 AM
Autoloading library methods? - by El Forum - 01-31-2011, 12:28 PM
Autoloading library methods? - by El Forum - 01-31-2011, 12:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB