src/MPageController.php
protected function renderJavascript()
    {
        $html = "";

        foreach( $this->javascript as $item )
        {
            $html .= sprintf( MPageController::JAVASCRIPT_TEMPLATE, $item["src"] ) . "\n";
        }

        $domQuery = $this->qp->find( "head" );
        if( $domQuery->count() <= 0 )
        {
            trigger_error( 'head tag not found in page', E_USER_WARNING );
        }
        else
        {
            $domQuery->append( $html );
        }
    }
protected function renderJavascript()
    {
        $html = "";

        foreach( $this->javascript as $item )
        {
            $html .= sprintf( MPageController::JAVASCRIPT_TEMPLATE, $item["src"] ) . "\n";
        }

        $domQuery = $this->qp->find( "head" );
        if( $domQuery->count() <= 0 )
        {
            trigger_error( 'head tag not found in page', E_USER_WARNING );
        }
        else
        {
            $domQuery->append( $html );
        }
    }
protected function renderJavascript ( ) { $ html = "" ; foreach ( $ this -> javascript as $ item ) { $ html .= sprintf ( MPageController :: JAVASCRIPT_TEMPLATE , $ item [ "src" ] ) . "\n" ; } $ domQuery = $ this -> qp -> find ( "head" ) ; if ( $ domQuery -> count ( ) <= 0 ) { trigger_error ( 'head tag not found in page' , E_USER_WARNING ) ; } else { $ domQuery -> append ( $ html ) ; } }
Render the script tag for Javascript at the end of head tag.
Render the script tag for Javascript at the end of head tag .