Welcome Guest, Not a member yet? Register   Sign In
How to get model function name
#1

[eluser]l1v1[/eluser]
Hi guys, so I need to get the model function name. For example:

Code:
class some_model extends CI_Model{

public function validate_contacts() {
$function_name = 'validate_contacts'; // how to do this automatic by not typing it manually?
$this->create_system_message($function_name, 'required');
$this->create_system_message($function_name, 'blablabla');
  /* ... other code ... */
}

}
#2

[eluser]Aken[/eluser]
__METHOD__

http://php.net/manual/en/language.consta...efined.php
#3

[eluser]l1v1[/eluser]
Thank you, didn't think it is so easy Smile




Theme © iAndrew 2016 - Forum software by © MyBB