【发布时间】:2018-05-30 09:19:26
【问题描述】:
您好,我在 url/v2/api/domain/file.php 文件夹中有文件,但是当我尝试执行 url/data/1, url/v2/api/domain/data /2。说: 404 not found 但如果我把 url/v2/api/domain/file.php/data/1 格式似乎不同并出现: Page Not Found 有人可以看到错误吗?
PD:不要写重复,因为它不是重复的,只是标题但问题不同。
找不到您要查找的页面。检查地址栏 以确保您的 URL 拼写正确。如果一切都失败了,你可以 通过以下链接访问我们的主页。
访问主页
代码:
<?php
require 'vendor/autoload.php';
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
$app = new \Slim\App;
$app->get('data/{name}', function (ServerRequestInterface $request, ResponseInterface $response, $args) {
// Use the PSR 7 $request object
return $response->write("Hello, " . $args['name']);
});
$app->run();
【问题讨论】: