![]() |
|
|
+ Search |
![]()
|
Mar 22nd, 2008 21:12
ha mo, Himanshu Jain,
Within a class,you can access a property or method by combining the
$this variable and the ->operator:
Class point
{
//properties
var $x = 0;
var $y = 0;
//constructor
function point( $x, $y )
{
// calling a method
$this->moveTo( $x, $y );
}
// method
function moveTo( $x ,$y)
{
//setting properties
$this->x = $x;
$this->y = $y;
}
}
http://www.tantofa.com
http://www.fantofa.com
http://www.mantofa.com
http://www.tanpola.com
http://www.tampola.com
http://www.yamot.com
http://www.mozmar.com
http://www.templatestemp.com