Skip to content

Instantly share code, notes, and snippets.

@bradley-holt
Created November 27, 2009 21:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save bradley-holt/244249 to your computer and use it in GitHub Desktop.
<?= $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