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(),’/’); ?>
Tag: php zend framework
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);
php zendframework truncate a string function
The programmers can use this <h4>truncate function in php zend framework</h4> to limit the string length <?php echo $mysmartcode = $this->string()->truncate(‘ i love u’, 5); ?>