Welcome Guest, Not a member yet? Register   Sign In
Calling helpers/classes inside another helper
#3

[eluser]ejangi[/eluser]
@simonspoken - Just to clarify the reason why $this throws an error inside a helper.

Helper functions are in the global namespace (not inside a class or anything like that) and therefore don't belong to an object. The $this variable is a reserved keyword (built into PHP itself) for accessing the containing object. So, because a helper function isn't inside a class/object PHP has not defined the $this variable and hence the error.

I hope that makes sense.


Messages In This Thread
Calling helpers/classes inside another helper - by El Forum - 02-20-2008, 05:56 AM
Calling helpers/classes inside another helper - by El Forum - 02-20-2008, 06:25 AM
Calling helpers/classes inside another helper - by El Forum - 02-20-2008, 04:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB