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

[eluser]Simon 24[/eluser]
Thanks a lot guys. But I think I solved my problem otherwise.

When I change the functions in de product model to static, I get the response I was looking for. The function get_called_class() then returns the name of the class I need.

Code:
class Crud extends CI_Model {
public static function inhertited_call()
{
  print get_called_class();
}

public static function forward()
{
  self::inhertited_call();
}
}

class Product extends Crud {

//static is very important here! Otherwise I get controller classname
public static function forwarded_call()
{
  self::forward();
}
}


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