Zend Framework 2, Model Error

1

Create a ZF2 project using composer and then create a module using the ZFTOOL called "Login".

The problem arises when adding a model, which is not working, here I add the captures of the project.

The error that I generated in the browser is the following: "Class Login \ Model \ Entity \ Model not Found in ....."

If I remove the call to the model the error goes.

I thank you in advance for your help.

Controller Code

<?php

  namespace Login\Controller;

  use Zend\Mvc\Controller\AbstractActionController;
  use Zend\View\Model\ViewModel;
  use Login\Model\Modelo;
  class IndexController extends AbstractActionController
  {



public function __construct(){

}

    public function indexAction()
    {
    $modelo = new Modelo();


     $result = new ViewModel();


    $result->setTerminal(true);

    return $result;
    }

    private function sesion(){


  }

}

Model Code

<?php

namespace Login\Model;

class Modelo {

    function __construct(){

    }

}

    
asked by Jose Jesus Villasmil Fermin 13.05.2016 в 00:52
source

1 answer

0

Change use Login\Model\Modelo to use Login\Model\Entity\Modelo; , I think this will solve, It is an error of namespace .

Namespace is called that does not exist in the controller.

I await your response.

    
answered by 17.05.2016 / 14:16
source