Page 1 of 1

"$this" in html file

Posted: Mon Oct 24, 2005 3:53 am
by wondershow
<html>
<body>
<a href="<?php print $this->getFullUrl('abc'); ?>">test</a>
</body>
</html>


"$this" is always used in a class defination to access class object itself.But in the html code,
no object of class is initialized,what does this "$this" mean?

Posted: Mon Oct 24, 2005 5:44 am
by Jenk
It won't mean anything, and will probably cause an exception of E_NOTICE error level, most probably of Undefined Variable.

If you are wishing to call upon a class method, without creating an object instance of the class, you can call it statically by using className::methodName()