Ismail
Ismail

Reputation: 9592

phalcon -> Fatal error class 'View' not found

When I visit domain.ext/manage Im getting the error: Fatal error class 'View' not found

My code:

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

This is what is causing the problem

View::LEVEL_ACTION_VIEW

Upvotes: 0

Views: 1279

Answers (1)

cvsguimaraes
cvsguimaraes

Reputation: 13240

You're making reference to a constant from Phalcon\Mvc\View. Add an "use" to this class in your code.

use Phalcon\Mvc\View;

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

Upvotes: 2

Related Questions