PluginManager::get war nicht in der Lage zu Holen, oder erstellen Sie eine Instanz für Controlador

Ich habe versucht, erstellen Sie ein plugin, controller, wie diese:

Application\src\Application\Controller\Plugin\Controlador.php

namespace Application\Controller\Plugin;

use Zend\Mvc\Controller\Plugin\AbstractPluginManager;
use Biblioteca\Mvc\Db\TableGateway;

class Controlador extends AbstractPluginManager
{

   protected function getTable($table){

        $sm = $this->getServiceLocator();
        $dbAdapter = $sm->get('DbAdapter');
        $tableGateway = new TableGateway($dbAdapter, $table, new $table);
        $tableGateway->initialize();

        return $tableGateway;
    }

    protected function getService($service)
    {
        return $this->getServiceLocator()->get($service);
    }
}

Und in meinem module.config.php ich habe diese:

'controllers' => array(
        'invokables' => array(
            'Application\Controller\Index' => 'Application\Controller\IndexController',

            'Controlador' => 'Application\Controller\Plugin\Controlador'
        ),
    ),

Und in meinem indexController.php wie diese:

namespace Application\Controller;</br>


use Zend\Mvc\Controller\AbstractActionController;

use Zend\View\Model\ViewModel;

use Biblioteca\ActionController;

class IndexController extends AbstractActionController{


    public function indexAction()
    {

        $controlador = $this->Controlador();

        return new ViewModel(array(
            'posts' => $controlador->getTable('Application\Model\Post')->fetchAll()->toArray()
        ));
    }
}

und wenn ich den code auszuführen bekomme ich die Meldung: "Zend\Mvc\Controller\PluginManager::get war nicht in der Lage zu Holen, oder erstellen Sie eine Instanz für Controlador"

kann mir jemand helfen ?

InformationsquelleAutor user2970025 | 2013-11-08

Schreibe einen Kommentar