The developers are can use this piece of code anywhere in zendframework project for get baseurl of currently running project. <?php echo rtrim(Zend_Controller_Front::getInstance()->getBaseUrl(),’/’); ?>
Category: zendframework
zendframework tips and tutorials, zendframework source codes, zendframework sql queries
Increase PHP Script Execution Time in zendframework ?
PHP script execution time in zendframework set_time_limit(0);
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); ?>
php zend framework email validation
zend framework email validation $value=array(‘smarttips@smarttips.in,test@gmail.com’); // Validate emails $validate = new Zend_Validate_EmailAddress(); $emails = array_unique(array_filter(array_map(‘trim’, preg_split(“/[s,]+/”, $value)))); if( empty($emails) ) { return false; } foreach( $emails as $email ) { if( !$validate->isValid($email) ) { return false; } }