PHP面向切面编程组件(4)
}
}
}
<?php
/**
* 扩展家族
*
* @author Mr.Jin
*/
class ExtensionFamily implements Extension{
public $_extensionArray = array();
/**
*
* @param type $extName 扩展名
* @param Extension $ext 实现Extension的对象
*/
public function addExtension($extName, Extension $ext){
$this->_extensionArray[$extName] = $ext;
}
public function beforeAppend(&$params){
foreach($this->_extensionArray as $ext){
$ext->beforeAppend($params);
}
}
public function afterAppend(&$params) {
foreach($this->_extensionArray as $ext){
$ext->afterAppend($params);
}
}
}
?>
<?php
/**
* 扩展家族
*
* @author Mr.Jin
*/
class ExtensionFamily implements Extension{
public $_extensionArray = array();
/**
*
* @param type $extName 扩展名
* @param Extension $ext 实现Extension的对象
*/
public function addExtension($extName, Extension $ext){
$this->_extensionArray[$extName] = $ext;
}
public function beforeAppend(&$params){
foreach($this->_extensionArray as $ext){
$ext->beforeAppend($params);
}
}
public function afterAppend(&$params) {
foreach($this->_extensionArray as $ext){
$ext->afterAppend($params);
相关新闻>>
- 发表评论
-
- 最新评论 更多>>