@@ -69,7 +69,7 @@ function route_rpc()
6969 if (class_exists ($ class )) {
7070 $ object = new $ class ();
7171 if ( method_exists ($ object , $ method ) ) {
72- $ object ->$ method ();
72+ return $ object ->$ method ();
7373 exit ();
7474 } else { exit (json_encode (['jsonrpc ' => '2.0 ' , 'error ' => ['code ' => 32601 , 'message ' => "Method not found. " ], 'id ' => $ json_rpc ['id ' ]])); }
7575 } else { exit (json_encode (['jsonrpc ' => '2.0 ' , 'error ' => ['code ' => 32601 , 'message ' => "Class not found. " ], 'id ' => $ json_rpc ['id ' ]])); }
@@ -92,7 +92,7 @@ function route_auto()
9292 if (class_exists ($ class )) {
9393 $ object = new $ class ();
9494 if ( method_exists ($ object , $ method ) ) {
95- $ object ->$ method ();
95+ return $ object ->$ method ();
9696 } else {
9797 header ($ _SERVER ["SERVER_PROTOCOL " ]." 404 Not Found " );
9898 exit ();
@@ -131,7 +131,7 @@ function route_class($http_method, $path, $class_method)
131131 list ($ class , $ method ) = explode ('@ ' , $ class_method );
132132
133133 $ object = new $ class ();
134- $ object ->$ method ();
134+ return $ object ->$ method ();
135135
136136 }
137137
@@ -153,7 +153,7 @@ function view($view, $data=NULL)
153153 if (isset ($ data )) { extract ($ data ); }
154154
155155 // Render Page View
156- require_once '../views/ ' . $ view . '.php ' ;
156+ return require_once '../views/ ' . $ view . '.php ' ;
157157
158158}
159159
0 commit comments