public function searchAction() { $translate = Zend_Registry::get('Zend_Translate'); if ($this->getRequest()->isPost()) { $term = trim($this->getRequest()->getParam('term')); if ($term == '') { $this->view->msg = $translate->_('Please enter some term to do the search'); $this->view->persons = array(); } else { $pd = new Persons_Domain_Person(); $this->view->persons = $pd->searchByName($term, Zend_Auth::getInstance()->getIdentity()->appaccount_id); if (count($this->view->persons) == 0) { $this->view->msg = $translate->_('No match found'); } else { $this->view->msg = $translate->_('Click on image to select'); } } } else { $this->view->msg = $translate->_('This function must be accessed by a post method'); } }