【发布时间】:2016-02-14 11:55:38
【问题描述】:
如果我删除查询,我在尝试查询数据库 (mongodb) 时似乎收到 500 错误,它显示视图正常。通过使用快速入门指南和其他在线教程,我没有发现我做错了什么。
模型 - Posts.php
<?php
namespace app\models;
class Posts extends \lithium\data\Model {
}
控制器 - PostsController.php
<?php
/**
* Lithium: the most rad php framework
*
* @copyright Copyright 2015, Union of RAD (http://union-of-rad.org)
* @license http://opensource.org/licenses/bsd-license.php The BSD License
*/
namespace app\controllers;
use app\models\Posts;
class PostsController extends \lithium\action\Controller {
public function index() {
$posts = Posts::find('all', array(
'conditions' => array('author' => 'tom')
));
return $this->render(array('layout' => false));
}
}
?>
查看 - index.html.php
包含一些文本没有 php 试图让它首先工作。
【问题讨论】: