0
我有一個小問題slimphp路由器:Slimphp 3嵌套組不工作
$app->group('/api', function() use ($app) {
// Library group
$this->group('/library', function() use ($app) {
// Get book with ID
$this->get('/books/:id', function ($req, $res) {
echo "books";
});
// Update book with ID
$this->put('/books/:id', function ($req, $res) {
});
// Delete book with ID
$this->delete('/books/:id', function ($req, $res) {
});
});
});
發送GET
到/ API /庫/書籍/ 1給我一個Page not found
錯誤,問題出在哪裏。
編輯:
的.htaccess
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [QSA,L]
PS:一個簡單的app->get
工作沒有任何問題,
?你似乎在混合每個代碼。 – meun5
我正在使用slim 3 – karim
您可以添加您的網絡服務器配置(即.htaccess)嗎? – meun5