13 public function get($datas){
14 $datas=\array_map(
function($o){
17 $datas=\array_values($datas);
18 return $this->
format([
"datas"=>$datas,
"count"=>\
sizeof($datas)]);
23 foreach ($o as $k=>$v){
27 foreach ($v as $index=>$values){
28 if(isset($values->_rest))
46 public function format($arrayResponse){
47 return \json_encode($arrayResponse);
51 $array=\explode(
"\\", $controllerName);
52 $result= \ucfirst(end($array));
54 $result=\substr($result, 0,-1);
60 return \json_encode($data);
64 return $this->
format([
"status"=>
"error",
"message"=>\utf8_encode($e->getMessage()),
"code"=>@$e->getCode()]);
67 public static function toXML($data,&$xml_data){
68 foreach( $data as $key => $value ) {
69 if( is_numeric($key) ){
72 if( is_array($value) ) {
73 $subnode = $xml_data->addChild($key);
74 array_to_xml($value, $subnode);
76 $xml_data->addChild(
"$key",htmlspecialchars(
"$value"));
static endswith($hay, $needle)