ZF-8792: don't modify code from programmer in addJavascript()

Issue Type: Performance Improvement Created: 2010-01-12T12:39:05.000+0000 Last Updated: 2010-01-29T01:46:20.000+0000 Status: Resolved Fix version(s): - 1.10.1 (10/Feb/10)

Reporter: Martin Minka (k2s) Assignee: Benjamin Eberlei (beberlei) Tags: - ZendX_JQuery

Related issues: Attachments:


As I suggested already in ZF-8011. Please don't modify code from programmer in ZendX_JQuery_View_Helper_JQuery_Container::addJavascript().

*  Why should PHP class fix JavaScript code which a programmer wrote ? He could make much more mistakes then to forget ; in last line or to enter too many spaces.
* Programmer could not put ; or } with a reason.
* This processing is taking unnecessary CPU on each request.
* It is confusing to the JavaScript programmer that his code got changed.
* Zend_View_Helper_HeadScript helper does not do such changes to javascript code

Please remove following lines in ZendX_JQuery_View_Helper_JQuery_Container::addJavascript():

<pre class="highlight">
$js = trim($js);
if (!in_array(substr($js, -1), array(';', '}'))) {
    $js .= ';';


Posted by Benjamin Eberlei (beberlei) on 2010-01-29T01:46:20.000+0000

Fixed in trunk and merged into 1.10 release branch.

Have you found an issue?

See the Overview section for more details.


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

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