13 public function get($datas){
15 return $this->
format([
"datas"=>$datas,
"count"=>\
sizeof($datas)]);
19 $datas=\array_map(
function($o){
22 return \array_values($datas);
31 foreach ($o as $k=>$v){
35 foreach ($v as $index=>$values){
36 if(isset($values->_rest))
54 public function format($arrayResponse){
55 return \json_encode($arrayResponse);
59 $array=\explode(
"\\", $controllerName);
60 $result= \ucfirst(end($array));
62 $result=\substr($result, 0,-1);
68 return \json_encode($data);
72 return $this->
format([
"status"=>
"error",
"message"=>\utf8_encode($e->getMessage()),
"code"=>@$e->getCode()]);
75 public static function toXML($data,&$xml_data){
76 foreach( $data as $key => $value ) {
77 if( is_numeric($key) ){
80 if( is_array($value) ) {
81 $subnode = $xml_data->addChild($key);
82 array_to_xml($value, $subnode);
84 $xml_data->addChild(
"$key",htmlspecialchars(
"$value"));
static endswith($hay, $needle)