通过以下composer生成slim的模板项目$ php composer.phar create-project slim/slim-skeleton [my-app-name]
$ cd [my-app-name]; php -S 0.0.0.0:8080 -t public public/index.php
运行起来有错误,需要修改成以下路径
require ‘/vendor/autoload.php‘;
// Prepare app
$app = new \Slim\Slim(array(
‘templates.path‘ => ‘./templates‘,
));
时间: 2024-10-13 11:29:30