I cant seem to find any documentation on what $_this
means in PHP. It seems to be used quite a bit in the CakePHP framework.
Any ideas?
I cant seem to find any documentation on what $_this
means in PHP. It seems to be used quite a bit in the CakePHP framework.
Any ideas?
$_this is not of any PHP reserved keywords ($this
however, is). Perhaps some kind of special variable in CakePHP.
Many individuals like to use some form of variable naming convention. In the case of private variables, people like to use $_
as a convention. I don't particularly know if this is the case in CakePHP, but elsewhere it's frequently seen.
An underscore typically denotes the scope of the variable. A variable with a leading underscore often means that it is protected or private. This is just a convention and is not enforced by the language. It helps make the code easier to read.
CakePHP follows a general nomenclature where variables starting with $_
are considered private to the class. They are not important for using the framework, however.