public function addJsRequirement($js, LambdaHelper $helper = null)
    {
        $js  = trim($js);
        $key = md5($js);

        if (!isset(self::$jsRequirements[$key])) {
            if ($helper !== null) {
                $js = $helper->render($js);
            }

            self::$jsRequirements[$key] = $js;
        }
    }
public function addJsRequirement($js, LambdaHelper $helper = null)
    {
        $js  = trim($js);
        $key = md5($js);

        if (!isset(self::$jsRequirements[$key])) {
            if ($helper !== null) {
                $js = $helper->render($js);
            }

            self::$jsRequirements[$key] = $js;
        }
    }
public function addJsRequirement ( $ js , LambdaHelper $ helper = null ) { $ js = trim ( $ js ) ; $ key = md5 ( $ js ) ; if ( ! isset ( self :: $ jsRequirements [ $ key ] ) ) { if ( $ helper !== null ) { $ js = $ helper -> render ( $ js ) ; } self :: $ jsRequirements [ $ key ] = $ js ; } }
Enqueue an external JavaScript file.

Must include `<script>` surrounding element.

@param string       $js     The JavaScript to add.
@param LambdaHelper $helper For rendering strings in the current context.
@return void
Enqueue an external JavaScript file .