私は ZF2 を初めて使用し、コントローラでポスト/取得パラメータを取得する際に問題があります。次の例外が表示されます。
Zend\ServiceManager\Exception\ServiceNotFoundException
Zend\Mvc\Controller\PluginManager::get was unable to fetch or create an instance for fromPost
私のindex.phtml
...
<form id="formActionCl" action="/public/checklistCore/delete" method="post">
<input type="submit" id="butto_doAction<?php echo $index;?>" hidden="true" value="<?php echo $this->translate('button_confirm_action', 'checklist');?>"/>
<input type="hidden" id="checklist" value="<?php echo $index;?>">
</form>
...
そしてコントローラー:
use Zend\Mvc\Controller\Plugin\AbstractPluginManager,
...
public function deleteAction()
{
$cl_id = $this->fromPost('checklist');
echo $cl_id;
//$cl_id = $_GET['checklist'];
$checklist = $this->getEntityManager()->getRepository('ChecklistCore\Entity\Checklist')->find($cl_id);
$checklist->status = 'inactiv';
$this->getEntityManager()->persist($checklist);
$this->getEntityManager()->flush();
return $this->redirect()->toUrl('index');
}
私はmodule.configで何かを忘れていると思いますが、何も見つかりません.serviceManagerを正しく宣言する方法( module.config.php )