提示:Class 'App\Common\Model\Link' not found
Severity: Fatal
File:E:\phpStudy\WWW\BLO\Storage\view\compile\afdce09b6879141ead2167fb28c505be.php Line: 5
LinkController.php
<?php namespace Admin\Controller;
use Hdphp\Controller\Controller;
//友情链接管理控制器
//use Common\Model\Link;
class LinkController extends CommonController{
//private $model;
private $link = null;
public function init(){
//调用CommonController里面的构造函数
parent::init();
//实例化arc模型
//$Link=M('Link');
//$this->model = new \Common\Model\Link;
$this->link = new \Common\Model\Link();
}
// 显示页
public function index(){
$linkData=$this->link->orderBy('sort','ASC')->get();
View::with('linkData',$linkData);
View::make();
}
Link.php
<?php namespace Common\Model;
use Hdphp\Model\Model;
//站点配置管理模型
//use Common\Model\Link;
class Link extends Model{
//指定表名
protected $table ="link";
//定义字段映射
protected $_map = array();
// 自动验证
protected $validate=array(
array("lname","required","名称不能为空",3,3),
array("url","required","url地址不能为空",3,3),