我已经安装了 Lithium 并在 Mac 上进行了测试。
我无法访问我定义的视图。我只能访问索引文件。
我的简单项目是firstLithium。我将它设置在 /Library/Webserver/Documents 在这个项目中,我创建了 1 个名为帖子的视图。下面是我的 MVC 的内容。
模型/Posts.php:
<?php
namespace app\models;
class Posts extends \lithium\data\Model {
}
?>
意见/帖子/index.html.php:
锂的密度低于 ium。
控制器/PostsController.php
<?php
namespace app\controllers;
class PostsController extends \lithium\action\Controller {
public function index() {
return array('foo' => 'bar', 'title' => 'Posts');
}
public function add() {
}
}
?>
从网络浏览器:
localhost/firstLithium :效果很好
localhost/firstLithium/posts :它不起作用
未找到 在此服务器上未找到请求的 URL /firstLithium/posts。相同的示例可以在 ubuntu 上运行,但不能在 Mac 上运行。我可以帮你在 Mac 上运行它吗?先感谢您。