PHP设计模式 注册表模式(多个类的注册)
以前我也写过一个注册表类,不过那一个不能进行多个类的注册,下面用数组对类进行了存储。 实现代码如下: siteName=$siteName; $this->siteUrl=$siteUrl; } function getName(){ return $this->siteName; }
以前我也写过一个注册表类,不过那一个不能进行多个类的注册,下面用数组对类进行了存储。 实现代码如下: siteName=$siteName; $this->siteUrl=$siteUrl; } function getName(){ return $this->siteName; }