3 function doEcho($data){
7 function multiply($num){
9 throw new Exception('Call to multiply with a value that is not a number');
14 function getTree($id){
17 for($i = 1; $i <= 5; ++$i){
18 array_push($out, array(
24 }else if(strlen($id) == 2){
25 $num = substr($id, 1);
26 for($i = 1; $i <= 5; ++$i){
27 array_push($out, array(
29 'text'=>'Node ' . $num . '.' . $i,
37 function getGrid($params){
38 $sort = $params->sort[0];
39 $field = $sort->property;
40 $direction = $sort->direction;
43 * Here we would apply a proper sort from the DB, but since
44 * it's such a small dataset we will just sort by hand here.
47 if ($field == 'name') {
49 'name'=>'ABC Accounting',
52 'name'=>'Ezy Video Rental',
55 'name'=>'Greens Fruit Grocery',
58 'name'=>'Icecream Express',
64 'name'=>'Smith Auto Mechanic',
69 'name'=>'ABC Accounting',
72 'name'=>'Icecream Express',
78 'name'=>'Ezy Video Rental',
81 'name'=>'Greens Fruit Grocery',
84 'name'=>'Smith Auto Mechanic',
88 if ($direction == 'DESC') {
89 $data = array_reverse($data);
94 function showDetails($data){
95 $first = $data->firstName;
96 $last = $data->lastName;
98 return "Hi $first $last, you are $age years old.";