$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; } }
Category: zendframework
zendframework tips and tutorials, zendframework source codes, zendframework sql queries
check if subject is set in socialengine
Check one subject is set in socialengine if(Engine_Api::_()->core()->hasSubject()) { } We can use the above code is for avoiding multiple subject set in socialengine.
How to simply create a zend framework project?
I’m writing this tutorial based on LAMP(Linux Apache Mysql PHP) development environment. You can create sample php zendframework project using terminal. For that type the following command smart@smarttips-System-Product-Name:~$ zf crate project /var/www/testzend If this package is not previously installed then will show this message The program ‘zf’ is currently not installed. You can install it…
select query cannot join with another table zend framework
$select = $table->select() ->setIntegrityCheck(false) ->from($tableName) ->joinRight($subtableName, ‘`’.$subtableName.’`.`user_id` = `’.$tableName.’`.`user_id`’,array(‘resource_approved’,’user_approved’)) ->where(‘`’.$subtableName.’`.`resource_id` = ?’, $resource->getIdentity()); Give the following sql statement for avoid “select query cannot join with another table zend framework” mysql error. setIntegrityCheck(false)
usort() function Issue with PHP 5.3
There is an issue existing with usort() function. Problem is purely related to php version, the old syntax is not work well in php 5.3 Here is the fix for usort() function Issue with PHP 5.3 usort($aResult, function ($elem1, $elem2) { return strcmp($elem1[‘title’], $elem2[‘title’]); }); solution Use a different function. usort($aResult,”mySort“); function mySort($elem1,$elem2){ return strcmp($elem1[‘title’],…