コード例 #1
0
 /**
  * Accept or ignore selected software
  *
  * @param bool $display Display status to set
  * @return mixed array(name) or redirect response
  */
 protected function _manage($display)
 {
     $name = $this->params()->fromQuery('name');
     if ($name === null) {
         throw new \RuntimeException('Missing name parameter');
     }
     if ($this->getRequest()->isGet()) {
         return array('name' => $name);
         // Display confirmation form
     } else {
         if ($this->params()->fromPost('yes')) {
             $this->_softwareManager->setDisplay($name, $display);
         }
         $session = new \Zend\Session\Container('ManageSoftware');
         return $this->redirectToRoute('software', 'index', array('filter' => $session->filter));
     }
 }