Issue Details (XML | Word | Printable)

Key: ZF-8847
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dolf Schimmel (Freeaqingme)
Reporter: Dolf Schimmel (Freeaqingme)
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

View resource plugin: Add ability to set doctype

Created: 17/Jan/10 05:43 AM   Updated: 21/Jan/10 08:15 AM   Resolved: 21/Jan/10 08:15 AM
Component/s: Zend_Application_Resource
Affects Version/s: None
Fix Version/s: 1.10.0

Time Tracking:
Not Specified


Rob Allen added a comment - 17/Jan/10 05:49 AM

The obvious patch is:

Index: library/Zend/Application/Resource/View.php
===================================================================
--- library/Zend/Application/Resource/View.php	(revision 20348)
+++ library/Zend/Application/Resource/View.php	(working copy)
@@ -46,6 +46,11 @@
     {
         $view = $this->getView();
 
+        $options = $this->getOptions();
+        if (isset($options['doctype'])) {
+            $view->doctype($options['doctype']);
+        }
+        
         $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
         $viewRenderer->setView($view);
         Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);

Rob Allen added a comment - 17/Jan/10 06:08 AM

To patch directly into Zend_View_Abstract:

Index: library/Zend/View/Abstract.php
===================================================================
--- library/Zend/View/Abstract.php	(revision 20351)
+++ library/Zend/View/Abstract.php	(working copy)
@@ -221,6 +221,11 @@
             $this->setLfiProtection($config['lfiProtectionOn']);
         }
 
+        // Doctype
+        if (array_key_exists('doctype', $config)) {
+            $this->doctype($config['doctype']);
+        }
+        
         $this->init();
     }