Welcome Guest, Not a member yet? Register   Sign In
How to get name of current class and function?
#4

[eluser]Mirage[/eluser]
You can just retrieve the segments in the constructor of your controller using the URI class. If you want it in every controller, create a master controller and subclass your controllers from that.

In your constructor of the master simply do what Colin suggests.

If you don't want to use a master controller you can use a post_controller_contstructor hook to set the properities in the controllers after the constructor runs.

For your logging needs the hook is the best way to automate it although you may want to do the logging at a different time (later in the process).

I really don't understand the automagic anchor update with class omission, but I'm sure you have a solid idea behind it...

Hope this helps -
-m


Messages In This Thread
How to get name of current class and function? - by El Forum - 09-08-2008, 01:40 PM
How to get name of current class and function? - by El Forum - 09-08-2008, 02:09 PM
How to get name of current class and function? - by El Forum - 09-08-2008, 03:50 PM
How to get name of current class and function? - by El Forum - 09-08-2008, 04:00 PM
How to get name of current class and function? - by El Forum - 09-08-2008, 04:24 PM
How to get name of current class and function? - by El Forum - 09-08-2008, 04:48 PM
How to get name of current class and function? - by El Forum - 09-09-2008, 12:32 AM
How to get name of current class and function? - by El Forum - 04-22-2009, 11:18 AM
How to get name of current class and function? - by El Forum - 04-22-2009, 11:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB