Welcome Guest, Not a member yet? Register   Sign In
PHP5 - private methods in controller
#1

[eluser]hepp[/eluser]
If you try to call a private method from the url, CI will fail ungracefully showing the php error:
Code:
First argument is expected to be a valid callback, 'Your_controller::method' was given

Proposed fix in CodeIgniter.php line 217 is to replace
Code:
if ( ! method_exists($CI, $method))
with
Code:
if ( ! method_exists($CI, $method) || ! is_callable(array($CI, $method)))

That way I don't have to prefix my methods with an underscore to keep them private Smile


Messages In This Thread
PHP5 - private methods in controller - by El Forum - 02-02-2008, 07:16 AM
PHP5 - private methods in controller - by El Forum - 06-13-2008, 07:50 PM
PHP5 - private methods in controller - by El Forum - 06-13-2008, 07:54 PM
PHP5 - private methods in controller - by El Forum - 06-14-2008, 06:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB