From 44c72954df288332e52e7c16e89bc1e2ffdd1a90 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 26 Feb 2009 11:18:20 -0500 Subject: [PATCH] Add missing setLayout method, change layout filenames to be *.html.php --- framework/Controller/lib/Horde/Controller/Base.php | 23 ++++++++++++++++++++++ framework/View/lib/Horde/View/Base.php | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/framework/Controller/lib/Horde/Controller/Base.php b/framework/Controller/lib/Horde/Controller/Base.php index 4c5a8b176..7c4ea7c83 100644 --- a/framework/Controller/lib/Horde/Controller/Base.php +++ b/framework/Controller/lib/Horde/Controller/Base.php @@ -378,6 +378,29 @@ abstract class Horde_Controller_Base } /** + * Set the layout template for the controller. Specify the name of the file in + * the /app/views/layouts directory without the .html extension + * + * + * setLayout('application'); + * } + * ... + * ?> + * + * + * @param string $layoutName + */ + protected function setLayout($layoutName) + { + $this->_useLayout = true; + $this->_layoutName = $layoutName; + } + + /** * Check if a render or redirect has been performed * @return boolean */ diff --git a/framework/View/lib/Horde/View/Base.php b/framework/View/lib/Horde/View/Base.php index 1e5661316..b6fa0fa00 100644 --- a/framework/View/lib/Horde/View/Base.php +++ b/framework/View/lib/Horde/View/Base.php @@ -370,7 +370,7 @@ abstract class Horde_View_Base protected function _template($name) { // append missing html - if (!strstr($name, '.')) { $name .= '.html'; } + if (!strstr($name, '.')) { $name .= '.html.php'; } if (!count($this->_templatePath)) { throw new Horde_View_Exception('No template directory set; unable to locate ' . $name); -- 2.11.0