【问题标题】:phalcon -> Fatal error class 'View' not foundphalcon -> 未找到致命错误类“视图”
【发布时间】:2014-05-17 12:30:59
【问题描述】:

当我访问 domain.ext/manage 我收到错误: 找不到致命错误类“视图”

我的代码:

class ManageController extends ControllerBase
{
    public function indexAction()
    {
        $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
    }
}

这是造成问题的原因

查看::LEVEL_ACTION_VIEW

【问题讨论】:

    标签: phalcon


    【解决方案1】:

    您正在引用constant from Phalcon\Mvc\View。 在你的代码中为这个类添加一个“使用”。

    use Phalcon\Mvc\View;
    
    class ManageController extends ControllerBase
    {
        public function indexAction()
        {
            $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
        }
    }
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-04-25
    • 1970-01-01
    • 2014-08-11
    • 2017-07-27
    • 2012-10-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多