Welcome Guest, Not a member yet? Register   Sign In
Form Validation Callback Functions
#1

[eluser]SpooF[/eluser]
Is there any way to make the callback functions private? In php 5 I can just add a private declaration in front. What can be done in php 4 besides just checking the method call in the construct?
#2

[eluser]Dyllon[/eluser]
Are you running PHP 5?
If so, use php 5 code, if not here's a chunk of the userguid.

Quote:Methods and variables that are only accessed internally by your class, such as utility and helper functions that your public methods use for code abstraction, should be prefixed with an underscore.

Code:
convert_text() // public method
_convert_text() // private method
#3

[eluser]SpooF[/eluser]
Turns out the function has to be public because its called from the form validation class. Right now I'm just make the function private via CodeIgniter with an underscore and in the validation I added another underscore.

Code:
array(
          'field'   => 'start_time',
          'label'   => 'Start Time',
          'rules'   => 'required|callback__time_check'
),




Theme © iAndrew 2016 - Forum software by © MyBB