无法将类型为Illuminate \ Http \ Response的对象用作数组(Larravel / October CMS)

时间:2019-12-13 13:31:49

标签: laravel octobercms

我在菜单(Build)上单击此错误,所以我不明白。有人可以帮我吗?为什么这会在下面的这一行令人发指?

     public function run($url = null)
    {
        $params = RouterHelper::segmentizeUrl($url);

        // Handle NotFoundHttpExceptions in the backend (usually triggered by abort(404))
        Event::listen('exception.beforeRender', function ($exception, $httpCode, $request) {
            if (!$this->cmsHandling && $exception instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException) {
                return View::make('backend::404');
            }
        }, 1);

        /*
         * Database check
         */
        if (!App::hasDatabase()) {
            return Config::get('app.debug', false)
                ? Response::make(View::make('backend::no_database'), 200)
                : $this->passToCmsController($url);
        }

 the erro start happining at this line---------->

        $controllerRequest = $this->getRequestedController($url);
        if (!is_null($controllerRequest)) {
            return $controllerRequest['controller']->run(
                $controllerRequest['action'],
                $controllerRequest['params']
            );
        }

        /*
         * Fall back on Cms controller
         */
        return $this->passToCmsController($url);
    }

1 个答案:

答案 0 :(得分:0)

要创建视图,您无需做出响应。代替

Response :: make(View :: make('backend :: no_database'),200)

使用

return View::make('backend::no_database');

或针对自定义页面的

return View::make('author.plugin::backend.file'); # htm is on views/backend/file.htm

通过上面的方式检查同一文件,它具有return View::make('backend::404');