摘要:
<?php/** 装饰模式 **/class Person { function __construct($name) { $this->name = $name; } function show() { } function showStyle() { $this->dis .= "$this->name style"; echo $this->dis; }}abstract class Finery { protected $person; public function decorate($per... 阅读全文
摘要:
<?php/** 简单工厂模式 **/abstract class CDb { abstract function connect(); abstract function query();}class CMysqlDB extends CDb { function connect() { echo 'mysql connect success'; } function query() { echo 'mysql query'; } }class CMssqlDb extends CDb { function connect() { echo 'm 阅读全文