CategoryModel
当我将它放在models
文件夹中时,我的作品。但是当我把它放在像user
. 它抛出上述错误。
如图所示,模型在控制器内部被调用。
public function home() {
// titling
$data['title'] = "Price Soldier - Home";
// controlling
$data['current_category'] = "cellphones";
$data['current_brand'] = "all";
$data['current_sorting'] = "latest";
$data['categories'] = CategoryModel::get_all_categories();
$data['brands'] = BrandModel::get_all_brands_by_category("cellphones");
$data['latests'] = ProductModel::get_products("cellphones", "all", "latest");
$data['mvs'] = ProductModel::get_products("cellphones", "all", "most viewed");
$data['plths'] = ProductModel::get_products("cellphones", "all", "price low to high");
$data['phtls'] = ProductModel::get_products("cellphones", "all", "price high to high");
// viewing
return View::make("pages.user.home", $data);
}
那么,简单来说,我如何访问子文件夹中的模型?