public function addAssetLibrary($library_id, array $options = array())
    {
        $added = array();

        foreach ($this->library->getFiles($library_id) as $file) {

            $extension = pathinfo($file, PATHINFO_EXTENSION);

            if ($extension === 'js') {
                $result = $this->setJs($file, $options);
            } else if ($extension === 'css') {
                $result = $this->setCss($file, $options);
            }

            if (!empty($result)) {
                $added[] = $file;
            }
        }

        return $added;
    }
public function addAssetLibrary($library_id, array $options = array())
    {
        $added = array();

        foreach ($this->library->getFiles($library_id) as $file) {

            $extension = pathinfo($file, PATHINFO_EXTENSION);

            if ($extension === 'js') {
                $result = $this->setJs($file, $options);
            } else if ($extension === 'css') {
                $result = $this->setCss($file, $options);
            }

            if (!empty($result)) {
                $added[] = $file;
            }
        }

        return $added;
    }
public function addAssetLibrary ( $ library_id , array $ options = array ( ) ) { $ added = array ( ) ; foreach ( $ this -> library -> getFiles ( $ library_id ) as $ file ) { $ extension = pathinfo ( $ file , PATHINFO_EXTENSION ) ; if ( $ extension === 'js' ) { $ result = $ this -> setJs ( $ file , $ options ) ; } else if ( $ extension === 'css' ) { $ result = $ this -> setCss ( $ file , $ options ) ; } if ( ! empty ( $ result ) ) { $ added [ ] = $ file ; } } return $ added ; }
Adds single or multiple asset libraries
@param string|array $library_id
@param array $options
@return array
Adds single or multiple asset libraries