注:Yaf 里的init 在下默认理解为__construct()
class Order{ private $extend = '; private $order = '; public function init(){ parent::init(); $this->order = new Order(); $this->extend = new OrderEx(); } public function listAction(){ $this->order->public(); } public function makeAction(){ $this->extend->public(); } }
与以下写法有什么不同吗?
class Order{ private $extend = '; private $order = '; public function init(){ parent::init(); } public function listAction(){ $order = new Order(); $order->public(); } public function makeAction(){ $extend= new extend(); $extend->public(); } }
在下小菜鸟一枚,希望有个良好的编程习惯,有些基础不踏实 还望指点
付费偷看金额在0.1-10元之间
一周热门 更多>