码迷,mamicode.com
首页 > Web开发 > 详细

php适配器模式

时间:2016-08-10 12:23:14      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

<?php
/**
* Created by PhpStorm.
* User: v.liumin
* Date: 2016/8/10
* Time: 11:17
*/
interface Target {
public function simpleMethod1();
public function simpleMethod2();
}

class Adaptree{
public function simpleMethod1(){
echo 22;
}
}

class Adapter implements Target {
private $adaptree;

public function __construct()
{
$this->adaptree = new Adaptree();
}

public function simpleMethod1()
{
$this->adaptree->simpleMethod1();
}

public function simpleMethod2()
{
echo 22;
}

}

php适配器模式

标签:

原文地址:http://www.cnblogs.com/best-jobs/p/5756036.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!