Add missing setLayout method, change layout filenames to be
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 26 Feb 2009 16:18:20 +0000 (11:18 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 26 Feb 2009 16:18:20 +0000 (11:18 -0500)
*.html.php

framework/Controller/lib/Horde/Controller/Base.php
framework/View/lib/Horde/View/Base.php

index 4c5a8b1..7c4ea7c 100644 (file)
@@ -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
+     *
+     * <code>
+     *  <?php
+     *  ...
+     *  public function _initialize()
+     *  {
+     *      $this->setLayout('application');
+     *  }
+     *  ...
+     *  ?>
+     * </code>
+     *
+     * @param   string  $layoutName
+     */
+    protected function setLayout($layoutName)
+    {
+        $this->_useLayout  = true;
+        $this->_layoutName = $layoutName;
+    }
+
+    /**
      * Check if a render or redirect has been performed
      * @return  boolean
      */
index 1e56613..b6fa0fa 100644 (file)
@@ -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);