src/DotsUnited/BundleFu/Bundle.php
public function addJsFile($file, $docRoot = null)
    {
        if (null === $docRoot) {
            $docRoot = $this->getDocRoot();
        }

        $docRoot = (string) $docRoot;

        if ('' !== $docRoot) {
            $docRoot .= DIRECTORY_SEPARATOR;
        }

        $file    = preg_replace('/^https?:\/\/[^\/]+/i', '', $file);
        $abspath = $docRoot . $file;

        $this->getJsFileList()->addFile($file, $abspath);

        return $this;
    }
public function addJsFile($file, $docRoot = null)
    {
        if (null === $docRoot) {
            $docRoot = $this->getDocRoot();
        }

        $docRoot = (string) $docRoot;

        if ('' !== $docRoot) {
            $docRoot .= DIRECTORY_SEPARATOR;
        }

        $file    = preg_replace('/^https?:\/\/[^\/]+/i', '', $file);
        $abspath = $docRoot . $file;

        $this->getJsFileList()->addFile($file, $abspath);

        return $this;
    }
public function addJsFile ( $ file , $ docRoot = null ) { if ( null === $ docRoot ) { $ docRoot = $ this -> getDocRoot ( ) ; } $ docRoot = ( string ) $ docRoot ; if ( '' !== $ docRoot ) { $ docRoot .= DIRECTORY_SEPARATOR ; } $ file = preg_replace ( '/^https?:\/\/[^\/]+/i' , '' , $ file ) ; $ abspath = $ docRoot . $ file ; $ this -> getJsFileList ( ) -> addFile ( $ file , $ abspath ) ; return $ this ; }
Add a javascript file.

@param  string $file
@param  string $docRoot
@return Bundle
Add a javascript file .