0
我不能讓斯利姆給我多一對夫婦GET路線的迴應:這是我的代碼:修身框架不會路由超過幾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重寫(給了我其他類型的錯誤),並且我試圖呈現DO的文件確實存在。
404表示找不到文件。 signup.php或dashboard.php確實存在於目錄 – GBD
剛剛編輯了上面的帖子提到。 –