Issues

ZF-8847: View resource plugin: Add ability to set doctype

Issue Type: Improvement Created: 2010-01-17T05:43:04.000+0000 Last Updated: 2010-08-19T11:31:03.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Dolf Schimmel (Freeaqingme) (freak) Assignee: Dolf Schimmel (Freeaqingme) (freak) Tags: - Zend_Application_Resource

Related issues: - ZF-10342

Attachments:

Description

Comments

Posted by Rob Allen (rob) on 2010-01-17T05:49:15.000+0000

The obvious patch is:

<pre class="highlight">

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);

Posted by Rob Allen (rob) on 2010-01-17T06:08:57.000+0000

To patch directly into Zend_View_Abstract:

<pre class="highlight">

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();
     }
 

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts