// +---------------------------------------------------------------------- // | Date: 2020-9-28 10:55:00 // +---------------------------------------------------------------------- namespace bw\poster; use bw\poster\template\Base; /** GD绘制工厂类 * Class Common * @package app\bwmall\model */ class PosterFactory { protected $tpl = null; public function __construct($tpl){ if(is_object($tpl)&&$tpl instanceof Base)$this -> tpl = $tpl; if(is_string($tpl))$this -> tpl = new $tpl; } //执行对应方法 public function __call($name,$arguments){ return $this->tpl->$name(...$arguments); } }