abstract class prmodel {// Product model
abstract function link();
}
Class Weblink Extends PRMODEL {// Example A product
Public function link(){
echo "www.2cto.com
}
}
class gongchang {
static public function createLink (){
return new webLink();
}
}
$weblink=gongchang::createLink(); //Create an object through the factory
$weblink->link(); //Output www.xxx.com
?>
Excerpted from chaojie2009’s column