Example #1
0
 protected function getJsonView($data, \Request $request)
 {
     if (!$request->isVar('command')) {
         throw new \Exception('Unknown Candidate command');
     }
     $json = array('success' => true);
     $command = $request->getVar('command');
     switch ($command) {
         case 'ticketList':
             $json = Factory::getTicketList(Factory::pullGetInteger('ticketId'));
             break;
         case 'candidateList':
             $json = Factory::getCandidateList(Factory::pullGetInteger('multipleId'));
             break;
     }
     $view = new \View\JsonView($json);
     return $view;
 }