<?php
//
interface Evaluation{
public function url($params);
}
//Diggme
class Diggme implements Evaluation{
//获取跳转的url
public function url($params){
}
public function curl($url){
}
}
//壹心理
class Yixinli implements Evaluation{
public function url($params){
echo "yixinli的url";
}
}
//测评家
class Cepingjia implements Evaluation{
public function url($params){
echo "cepingjia的url";
}
}
class evaluationFactory{
public static function factory($Evaluation)
{
switch ($Evaluation) {
case 'diggme':
return new Diggme();
break;
case 'yixinli':
return new Yixinli();
break;
case 'Cepingjia':
return new Cepingjia();
break;
}
}
}
$Evaluation=evaluationFactory::factory('diggme');
$params=[
'id'=>1
];
$Evaluation->url($params);
网友评论