0

我无法让 Slim 给我超过几个 GET 路由的响应:这是我的代码:

<?php

ini_set('display_errors', 'On');
error_reporting(E_ALL);

require 'Slim/Slim.php';
\Slim\Slim::registerAutoloader();

$app = new \Slim\Slim();

$app->config(array(
   'templates.path' => './templates'
));

$app->get('/', function () use ($app) {
    $app->render('landing.php');
});

$app->get('/about', function () use ($app) {
    $app->render('about.php');
});

$app->get('/signup', function () use ($app) {
    $app->render('signup.php');
});

$app->get('/dashboard', function () use ($app) {
    $app->render('dashboard.php');
});

$app->run();

?>

当我运行时它工作正常localhost:8888,Slim 渲染landing.php正常,如果我输入localhost:8888/index.php/about它会渲染关于页面,但是一旦我输入它localhost:8888/index.php/signup就会localhost:8888/index.php/dashboard失败并出现 404 错误。任何帮助,将不胜感激。

澄清一下,我没有在我的服务器上设置 URL 重写(给了我其他类型的错误),而且我试图渲染的文件确实存在。

4

1 回答 1

1

我编辑了错误的文件,对不起,我的错。

于 2012-11-13T05:44:51.643 回答