public static function setPageEnvironment(sfAction $action, aPage $page) { // Title is pre-escaped as valid HTML $prefix = aTools::getOptionI18n('title_prefix'); $action->getResponse()->setTitle($prefix . $page->getTitle(), false); // Necessary to allow the use of // aTools::getCurrentPage() in the layout. // In Symfony 1.1+, you can't see $action->page from // the layout. aTools::setCurrentPage($page); // Borrowed from sfSimpleCMS if (sfConfig::get('app_a_use_bundled_layout', true)) { $action->setLayout(sfContext::getInstance()->getConfiguration()->getTemplateDir('a', 'layout.php') . '/layout'); } // Loading the a helper at this point guarantees not only // helper functions but also necessary JavaScript and CSS sfContext::getInstance()->getConfiguration()->loadHelpers('a'); }