Slim 3框架组路由

I want to use group routing in Slim 3 Framework, but I always get "Object not found! The requested URL was not found on this server". I am not sure what I did wrong. Here's the code I wrote:

<?php

require "vendor/autoload.php";

$app = new \Slim\App();

// API Version Group
$app->group("/v1", function() use($app) {
   $app->get("/test1", function() use($app){
       return "from v1 tes1";
   });
});

//Run the app
$app->run();

?>

I ran this locally like : http://localhost/MyAPI/v1/test1. Can anyone help me?

Thanks

查看全部
douqiao2008
douqiao2008
2016/08/31 08:54
  • slim
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复