src/Common/Service/Asset.php
public function inline($sScript = null, $sForceType = null, $sJsLocation = 'FOOTER')
    {
        if (!empty($sScript)) {

            $sJsLocation = strtoupper($sJsLocation);
            if ($sJsLocation != 'FOOTER' && $sJsLocation != 'HEADER') {
                throw new AssetException(
                    '"' . $sJsLocation . '" is not a valid inline JS location value.',
                    1
                );
            }

            $sType = $this->determineType($sScript, $sForceType);

            switch ($sType) {

                case 'CSS-INLINE':
                case 'CSS':

                    $this->aCssInline['INLINE-CSS-' . md5($sScript)] = $sScript;
                    break;

                case 'JS-INLINE':
                case 'JS':

                    if ($sJsLocation == 'FOOTER') {
                        $this->aJsInlineFooter['INLINE-JS-' . md5($sScript)] = $sScript;
                    } else {
                        $this->aJsInlineHeader['INLINE-JS-' . md5($sScript)] = $sScript;
                    }
                    break;
            }
        }

        return $this;
    }
public function inline($sScript = null, $sForceType = null, $sJsLocation = 'FOOTER')
    {
        if (!empty($sScript)) {

            $sJsLocation = strtoupper($sJsLocation);
            if ($sJsLocation != 'FOOTER' && $sJsLocation != 'HEADER') {
                throw new AssetException(
                    '"' . $sJsLocation . '" is not a valid inline JS location value.',
                    1
                );
            }

            $sType = $this->determineType($sScript, $sForceType);

            switch ($sType) {

                case 'CSS-INLINE':
                case 'CSS':

                    $this->aCssInline['INLINE-CSS-' . md5($sScript)] = $sScript;
                    break;

                case 'JS-INLINE':
                case 'JS':

                    if ($sJsLocation == 'FOOTER') {
                        $this->aJsInlineFooter['INLINE-JS-' . md5($sScript)] = $sScript;
                    } else {
                        $this->aJsInlineHeader['INLINE-JS-' . md5($sScript)] = $sScript;
                    }
                    break;
            }
        }

        return $this;
    }
public function inline ( $ sScript = null , $ sForceType = null , $ sJsLocation = 'FOOTER' ) { if ( ! empty ( $ sScript ) ) { $ sJsLocation = strtoupper ( $ sJsLocation ) ; if ( $ sJsLocation != 'FOOTER' && $ sJsLocation != 'HEADER' ) { throw new AssetException ( '"' . $ sJsLocation . '" is not a valid inline JS location value.' , 1 ) ; } $ sType = $ this -> determineType ( $ sScript , $ sForceType ) ; switch ( $ sType ) { case 'CSS-INLINE' : case 'CSS' : $ this -> aCssInline [ 'INLINE-CSS-' . md5 ( $ sScript ) ] = $ sScript ; break ; case 'JS-INLINE' : case 'JS' : if ( $ sJsLocation == 'FOOTER' ) { $ this -> aJsInlineFooter [ 'INLINE-JS-' . md5 ( $ sScript ) ] = $ sScript ; } else { $ this -> aJsInlineHeader [ 'INLINE-JS-' . md5 ( $ sScript ) ] = $ sScript ; } break ; } } return $ this ; }
Loads an inline asset

@param  string $sScript     The inline asset to load, wrap in script tags for JS, or style tags for CSS
@param  string $sForceType  Force a particular type of asset (i.e. JS-INLINE or CSS-INLINE)
@param  string $sJsLocation Where the inline JS should appear, accepts FOOTER or HEADER

@return object
Loads an inline asset