Welcome Guest, Not a member yet? Register   Sign In
get_class_name
#1

[eluser]Simon 24[/eluser]
Hi there,

Does anyone know how I can determine the classname in a function of My_Model when I call this function through an uninstantiated descendant class. Like so:

Code:
class My_Model extends CI_Model {

  function whoami()
  {
    print get_called_class();
  }

}

class Book extends My_Model {
}

I call the function from a controller like so:

Code:
Book::whoami();

The result of this is that the name of the controller gets printed.

Does anyone know?

Thanks!
Sander


Messages In This Thread
get_class_name - by El Forum - 07-23-2012, 03:43 AM
get_class_name - by El Forum - 07-23-2012, 06:20 AM
get_class_name - by El Forum - 07-23-2012, 06:54 AM
get_class_name - by El Forum - 07-23-2012, 07:02 AM
get_class_name - by El Forum - 07-23-2012, 07:05 AM
get_class_name - by El Forum - 07-23-2012, 07:42 AM
get_class_name - by El Forum - 07-23-2012, 10:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB