Latest news
Home » SocialEngine » Pass custom error message to zend/socialengine form from controller

Pass custom error message to zend/socialengine form from controller

$this->view->form = $form = new User_Form_Admin_Universities_Createdomain();
$this->view->university_id = $iId = $this->_getParam(‘id’, null);
$form->populate(array(‘university_id’=>$iId));

if($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost()) )
{

$iExists = $oUniversitydomains->ifExistsDomain(‘domain’, $aData[‘domain’], $aData[‘university_id’]);
if($iExists > 0) {

$message = ‘Domain Name Already Registered’;
             $form->getElement(‘domain’)->addError($message);
             return;
}

}

Leave a Reply

x

Check Also

Get parameter value in socialengine or zendframework

Get parameter value in socialengine/zendframework $this->_getParam(‘id’, null) $this->getRequest()->getParam(‘fancybox’, null);