Welcome Guest, Not a member yet? Register   Sign In
Get the name of class?
#1

[eluser]lkoreality[/eluser]
How can i retrieve the name of the class/function that's in use? (site.com/class/function)

For example, I want to say:
Code:
if (NameOfClass() == 'welcome') {.....

and also the name of the function coming after it in the url.

How do I do this?

I did try using class_parents and when it returns false (due to error) it worked for what i needed specifically (with error reporting off) but I don't think that's safe practice.

I also thought I could use the url name (site.com/class/function) but that would make things complicated since i'm removing index.php and it would screw up things if i used index.php for whatever reason.

Any ideas?!
#2

[eluser]Doosje[/eluser]
Hi,
look at http://nl3.php.net/language.constants.predefined
It's there .. already in php !!!
#3

[eluser]pistolPete[/eluser]
You can also use get_class() or have a look at the URI Class.
#4

[eluser]lkoreality[/eluser]
Ahh! I found it. Hiding under the ci user guides. it was in uri class! thanks guys Wink




Theme © iAndrew 2016 - Forum software by © MyBB