Note that there are some explanatory texts on larger screens.

plurals
  1. POZend framework 2 starting with error
    primarykey
    data
    text
    <p>I'm new with Zf2 and when I wan't add a new module to get start I met this error:</p> <pre><code>File: D:\wamp\www\akulubala_project\system\Zend\ServiceManager\ServiceManager.php:455 Message: Zend\Mvc\Controller\PluginManager::get was unable to fetch or create an instance for getakulubalaTablekulubalaTable Stack trace: #0 D:\wamp\www\akulubala_project\system\Zend\ServiceManager\AbstractPluginManager.php(103): Zend\ServiceManager\ServiceManager-&gt;get('getakulubalaTab...', true) #1 D:\wamp\www\akulubala_project\system\Zend\Mvc\Controller\PluginManager.php(98): Zend\ServiceManager\AbstractPluginManager-&gt;get('getakulubalaTab...', NULL, true) #2 D:\wamp\www\akulubala_project\system\Zend\Mvc\Controller\AbstractController.php(285): Zend\Mvc\Controller\PluginManager-&gt;get('getakulubalaTab...', NULL) #3 D:\wamp\www\akulubala_project\system\Zend\Mvc\Controller\AbstractController.php(300): Zend\Mvc\Controller\AbstractController-&gt;plugin('getakulubalaTab...') #4 D:\wamp\www\akulubala_project\module\Akulubala\src\Akulubala\Controller\IndexController.php(14): Zend\Mvc\Controller\AbstractController-&gt;__call('getakulubalaTab...', Array) #5 D:\wamp\www\akulubala_project\module\Akulubala\src\Akulubala\Controller\IndexController.php(14): Akulubala\Controller\IndexController-&gt;getakulubalaTablekulubalaTable() </code></pre> <p>My Program structure is like this:</p> <p><img src="https://i.stack.imgur.com/frTWf.jpg" alt="enter image description here"></p> <p>and <code>Module.php</code> under Akulubala is:</p> <pre><code>namespace Akulubala; use Akulubala\Module\AkulubalaTable; use Akulubala\Module\Akulubala; use Zend\Db\ResultSet\ResultSet; use Zend\Db\TableGateway\TableGateway; class Module { public function getAutoloaderConfig() { return array( 'Zend\Loader\ClassMapAutoloader' =&gt; array(__DIR__.'/autoload_classmap.php'), 'Zend\Loader\StandardAutoloader' =&gt; array( 'namespaces' =&gt; array( __NAMESPACE__ =&gt; __DIR__ .'/src/'.__NAMESPACE__,), ), ); } public function getConfig() { return include __DIR__ . '/config/module.config.php'; } public function getServiceConfig() { return array( 'factories' =&gt; array( 'Akulubala\Model\AkulubalaTable' =&gt; function($sm) { $tableGateway = $sm-&gt;get('AkulubalaTableGateway'); $table = new AkulubalaTable($tableGateway); return $table; }, 'AkulubalaTableGateway' =&gt; function ($sm) { $dbAdapter = $sm-&gt;get('Zend\Db\Adapter\Adapter'); $resultSetPrototype = new ResultSet(); $resultSetPrototype-&gt;setArrayObjectPrototype(new Akulubala()); return new TableGateway('Akulubala', $dbAdapter, null, $resultSetPrototype); }, ), ); } } </code></pre> <p><code>config/autoload/global.php</code> is return array( 'db' => array( 'driver' => 'MYSQLI', 'dbname'=> 'akulubala', 'host'=> 'localhost', 'options' => array( 'buffer_results' => true ), ), 'service_manager' => array( 'factories' => array( 'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory', ), ), ) ;</p> <p>here is my controller file:</p> <pre><code>namespace Akulubala\Controller; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; class IndexController extends AbstractActionController { protected $akulubalaTable; public function indexAction() { return new ViewModel(array('akulubala' =&gt; $this-&gt;getakulubalaTable()-&gt;fetchAll())); } public function getakulubalaTable() { if (!$this-&gt;akulubalaTable) { $sm = $this-&gt;getServiceLocator(); $this-&gt;akulubalaTable = $sm-&gt;get('Akulubala\Module\AkulubalaTable'); } return $this-&gt;akulubalaTable; } public function editAction() { } public function deleteAction() { } public function addAction() { } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload