Hy how to make controller with json and soap support?
class ApiController extends CController {
public function actionGetExample($type='json') {
switch ($type) {
case 'json':
return CJSON::encode($this->example);
break;
case 'xml':
return makesoap(self::$this->example);
break;
default:
break;
}
}
}
Any idea?