Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<?= $this->doctype() ?>
<html>
<head>
<?= $this->headTitle() ?>
<?= $this->headMeta() ?>
<?= $this->headLink() ?>
<?= $this->headScript() ?>
</head>
<body<?= 0 != count($this->routeContext) ? ' class="' . implode(' ', array_unique($this->routeContext)) . '"' : '' ?>>
</body>
</html>
<?php
/**
* @category Default
* @package Default_Plugin
* @copyright Copyright (c) 2005-2010 Found Line, Inc. (http://www.foundline.com/)
* @license http://www.foundline.com/legal/software-license/ New BSD License
*/
/**
* Route Context Plugin
*
* @category Default
* @package Default_Plugin
* @copyright Copyright (c) 2005-2010 Found Line, Inc. (http://www.foundline.com/)
* @license http://www.foundline.com/legal/software-license/ New BSD License
*/
class Default_Plugin_RouteContext extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$view = Zend_Layout::getMvcInstance()->getView();
$routeContext = array(
$request->getModuleName(),
$request->getControllerName(),
$request->getActionName(),
);
$view->routeContext = $routeContext;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment