thinphp5.1控制器不存在

浏览:303 发布日期:2021/03/04 分类:ThinkPHP5专区
[0] HttpException in Module.php line 96
控制器不存在:app\admin\controller\DataApi
$this->app['hook']->listen('module_init');

try {
// 实例化控制器
$instance = $this->app->controller($this->controller,
$this->rule->getConfig('url_controller_layer'),
$this->rule->getConfig('controller_suffix'),
$this->rule->getConfig('empty_controller'));
} catch (ClassNotFoundException $e) {
throw new HttpException(404, 'controller not exists:' . $e->getClass());
}

$this->app['middleware']->controller(function (Request $request, $next) use ($instance) {
// 获取当前操作名
$action = $this->actionName . $this->rule->getConfig('action_suffix');

if (is_callable([$instance, $action])) {
// 执行操作方法
$call = [$instance, $action];<?php

namespace app\admin\controller;

use think\Controller;
use app\admin\modal\service\Service;
use app\admin\validate\Val;
use think\Exception;
use think\exception\PDOException;
use think\facade\Request;

class DataApi extends Controller
{
    /**
     * @var Service $Object 依赖注入对象声明
     */
    protected  $Object;
最佳答案
评论( 相关
后面还有条评论,点击查看>>