composer.jsonでzendコンポーネントのリストを指定しました
"zendframework/zend-xmlrpc": "2.0.*",
"zendframework/zend-config": "2.0.*",
"zendframework/zend-log": "2.0.*",
"zendframework/zend-db": "2.0.*",
"zendframework/zend-inputfilter": "2.0.*",
"zendframework/zend-json": "2.0.*",
"zendframework/zend-form": "2.0.*",
"zendframework/zend-mvc" : "2.0.*",
"zendframework/zend-session" : "2.0.*",
"zendframework/zend-view" : "2.0.*"
しかし、ビュースクリプト内にフォームを出力しようとすると:
<?php
use Zend\Form\Form;
use Zend\Form\Element;
$form = new Form();
$form->setAttribute('action', '/contact/process');
$form->setAttribute('method', 'post');
$form->prepare();
echo $this->form()->openTag($form);
echo $this->form()->closeTag();
?>
例外が発生します:
ServiceNotFoundException: Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for form
#in /var/www/projectdir/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceManager.php line 452
#at ServiceManager->get('form', true) in /var/www/projectdir/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/AbstractPluginManager.php line 110
#at AbstractPluginManager->get('form', null) in /var/www/projectdir/vendor/zendframework/zend-view/Zend/View/Renderer/PhpRenderer.php line 340
#at PhpRenderer->plugin('form') in /var/www/projectdir/vendor/zendframework/zend-view/Zend/View/Renderer/PhpRenderer.php line 359
#at PhpRenderer->__call('form', array()) in /var/www/projectdir/views/editWorker.phtml line 19
#at PhpRenderer->form() in /var/www/projectdir/views/editWorker.phtml line 19
.....
ただし、$ this-> htmlList($ items)などの他のビューヘルパーは正しく機能します