From d9000c12c74fece118fe8e49056f2dcb799f9ffb Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Wed, 18 Jan 2017 17:22:24 -0500 Subject: [PATCH] More routing changes --- api/index.php | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/api/index.php b/api/index.php index dfcb9e63..ca5719ef 100644 --- a/api/index.php +++ b/api/index.php @@ -5,10 +5,26 @@ //require_once(__DIR__ . '/core/common.php'); require(__DIR__ . '/../Link/src/Link.php'); -function routeMe(){ - echo 'I am routed'; +class HomeController +{ + + function get($i){ + echo 'You have got to home :) Val:' . intval($i); + } + + function post(){ + echo 'You have posted to home'; + } + + function put(){ + echo 'You have put to home'; + } + + function delete(){ + echo 'You have deleted the home :('; + } } -Link::all( array( - '/test' => 'routeMe', +Link::all(array( + '/test/{i}' => 'HomeController', )); \ No newline at end of file