• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Do i HAVE to use a helper file?

#2
[eluser]Michael Wales[/eluser]
You are in an object oriented development environment - you need to tell PHP what class to find that particular function in. In this case, $this works just fine.

Code:
$data['variables'] = array("username"   => $username,
                           "password"   => hash("sha256", $password),
                           "user_valid" => $this->validate_username($username));

On a side note, you probably want to make that function private by prepending an underscore (function _validate_username). Otherwise it is accessible via the URI.


Messages In This Thread
Do i HAVE to use a helper file? - by El Forum - 12-02-2008, 02:06 PM
Do i HAVE to use a helper file? - by El Forum - 12-02-2008, 02:12 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.