Issues

ZF-10284: Method Zend_View_Helper_HeadTitle::setDefaultAttachOrder() don't return $this

Issue Type: Improvement Created: 2010-08-09T05:31:02.000+0000 Last Updated: 2010-08-21T14:23:14.000+0000 Status: Resolved Fix version(s): - 1.11.0 (02/Nov/10)

Reporter: Grégory PLANCHAT (gplanchat) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_View

Related issues: Attachments:

Description

The method Zend_View_Helper_HeadTitle::setDefaultAttachOrder() don't return $this object, which throws a fatal error with some use cases.

This code works well :

<pre class="highlight">
<?php
$view->headTitle($view->translate('CORE_SiteTitle'))
    ->setSeparator(' - ')
    ->setDefaultAttachOrder(Zend_View_Helper_Placeholder_Container_Abstract::PREPEND)
;

This code throws a fatal error :

<pre class="highlight">
<?php
$view->headTitle($view->translate('CORE_SiteTitle'))
    ->setDefaultAttachOrder(Zend_View_Helper_Placeholder_Container_Abstract::PREPEND)
    ->setSeparator(' - ')
;

I made a little fixing patch :

<pre class="highlight">
Index: lib/Zend/View/Helper/HeadTitle.php
===================================================================
--- lib/Zend/View/Helper/HeadTitle.php  (revision 22655)
+++ lib/Zend/View/Helper/HeadTitle.php  (working copy)
@@ -105,6 +105,8 @@
             throw new Zend_View_Exception("You must use a valid attach order: 'PREPEND', 'APPEND' or 'SET'");
         }
         $this->_defaultAttachOrder = $setType;
+
+        return $this;
     }
 
     /**

Regards

Greg

Comments

Posted by Ramon Henrique Ornelas (ramon) on 2010-08-21T14:18:42.000+0000

I believe it is an improvement and not a bug.

Posted by Ramon Henrique Ornelas (ramon) on 2010-08-21T14:23:14.000+0000

Fixed with r22879. Thanks by your report.

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