-<?php\r
-class TestAction {\r
- function doEcho($data){\r
- return $data;\r
- }\r
-\r
- function multiply($num){\r
- if(!is_numeric($num)){\r
- throw new Exception('Call to multiply with a value that is not a number');\r
- }\r
- return $num*8;\r
- }\r
-\r
- function getTree($id){\r
- $out = array();\r
- if($id == "root"){\r
- for($i = 1; $i <= 5; ++$i){\r
- array_push($out, array(\r
- 'id'=>'n' . $i,\r
- 'text'=>'Node ' . $i,\r
- 'leaf'=>false\r
- ));\r
- }\r
- }else if(strlen($id) == 2){\r
- $num = substr($id, 1);\r
- for($i = 1; $i <= 5; ++$i){\r
- array_push($out, array(\r
- 'id'=>$id . $i,\r
- 'text'=>'Node ' . $num . '.' . $i,\r
- 'leaf'=>true\r
- ));\r
- }\r
- }\r
- return $out;\r
- }\r
-}\r
+<?php
+class TestAction {
+ function doEcho($data){
+ return $data;
+ }
+
+ function multiply($num){
+ if(!is_numeric($num)){
+ throw new Exception('Call to multiply with a value that is not a number');
+ }
+ return $num*8;
+ }
+
+ function getTree($id){
+ $out = array();
+ if($id == "root"){
+ for($i = 1; $i <= 5; ++$i){
+ array_push($out, array(
+ 'id'=>'n' . $i,
+ 'text'=>'Node ' . $i,
+ 'leaf'=>false
+ ));
+ }
+ }else if(strlen($id) == 2){
+ $num = substr($id, 1);
+ for($i = 1; $i <= 5; ++$i){
+ array_push($out, array(
+ 'id'=>$id . $i,
+ 'text'=>'Node ' . $num . '.' . $i,
+ 'leaf'=>true
+ ));
+ }
+ }
+ return $out;
+ }
+}