Categories
Web Development Zend Framework 1.12

Zend Framework Tips and Tricks

To Redirect:

/controllers/yourcontroller::youAction()
$this->_redirect('/path/to/place');

To Show Profiler in a layout
/layouts/yourlayout.phtml
$this->addScriptpath(APPLICATION_PATH . '/profiler/views/scripts');
echo $this->render('util/profiler.phtml');

/application/profiler/views/scripts/util/profiler.phtml
getProfiler();
if($profiler->getEnabled() && $profiler->getTotalNumQueries() > 0) { ?>

Database Profiling Report

Total queries executed: getTotalNumQueries()?>

Total elapsed time: getTotalElapsedSecs()?>

getQueryProfiles() as $queryNumber => $query) { ?>


# Query Time
() getQuery();?> getElapsedSecs();?>

Disable Zend Layout:

$this->_helper->layout->disableLayout();
source: Web Development Blog