socialengine basically using zendframework for development. Zendframework methods can see all through the socialengine code. Session is an important functionality in programming. For achieving the session in socialengine use the following code $session = new Zend_Session_Namespace(‘invite’); $session->invite_code = $this->_getParam(‘code’); $session->invite_email = $this->_getParam(’email’);
Author: smarttips
Manju Warrier kalyan jewellers advertisement
Manju Warrier kalyan advertisement…. Manju Warrier Snaps
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’);
How to download or print a page using PHP and javascript
jQuery(‘.payment-print’).live(‘click’, function() { var sUrl = jQuery(‘#base-url’).val() + ‘/jobs/paymentprint/id/’ + jQuery(this ).attr(“id”); jQuery.post(sUrl, function(data){ var HTML = data; var WindowObject = window.open(” “, “PrintWindow”, “width=769,height=601,top=40,left=40,toolbars=no”); WindowObject.document.writeln(HTML); WindowObject.document.close(); WindowObject.focus(); WindowObject.print(); WindowObject.close(); }) });
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.’); } }