Get parameter value in socialengine/zendframework $this->_getParam(‘id’, null) $this->getRequest()->getParam(‘fancybox’, null);
Tag: zend framewrok
call view helper in api or plugin of socialengine
View property is not available in plugin .So call view property using zend and use this for get view helper $view = Zend_Registry::get(‘Zend_View’); $job_status = $view->getJobStatus(‘id’);
Pass custom error messages to form in socialengine / zend framework
if( !$form->isValid($this->getRequest()->getPost()) ) { return; } // Process $values = $form->getValues(); if( ($CouponCode = $form->getElement(‘coupon_code’)) && isset($values[‘coupon_code’])) { $iCouponExist = $table->checkCouponExist($values[‘coupon_code’]); if($iCouponExist == 1) { return $CouponCode->addError(‘This Coupon Code is not available, please use another one.’); } }
Zend framework select Query with order Random
Use order(‘RAND()’) in zendframework select query for fetching records in random. $usersTable = Engine_Api::_()->getItemTable(‘user’); $select = $usersTable->select() ->where(‘enabled = ?’, 1) ->where(‘approved = ?’, 1) ->order(‘RAND()’) ->limit(5);
File download zend framework php script
File download zend framework php script <?php $imagePath = getcwd().’/public/images/smartips_log.png’; header(‘Content-Type: image/jpeg’); header(‘Content-Disposition: attachment; filename=smartips_log.png’); readfile($imagePath); ?>