Home>Article>Backend Development> A simple example of interface adaptation in PHP adapter mode

A simple example of interface adaptation in PHP adapter mode

黄舟
黄舟 Original
2017-03-15 09:47:27 1272browse

PHPAdapter patternInterfaceSimple example of adaptation

action2', '
'; } } class Adapter2 extends AbstractAdapter { public function action3() { echo 'call action3', '
'; } } // test code $a1 = new Adapter(); $a1->action2(); $a2 = new Adapter2(); $a2->action3();

The above is the detailed content of A simple example of interface adaptation in PHP adapter mode. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn