protected function loadCss($css, $options=array())
    {
        $location = (isset($options['location'])) ? $options['location']:'internal';

        //after:file, before:file, first, last
        $position = (isset($options['position'])) ? $options['position']:'last';

        if(!in_array($css,$this->data['css'][$location])){
            if($position=='first' || $position=='last'){
                $key = $position;
                $file='';
            }else{
                list($key,$file) =  explode(':',$position);
            }

            switch($key){
                case 'first':
                    array_unshift($this->data['css'][$location],$css);
                break;

                case 'last':
                    $this->data['css'][$location][]=$css;
                break;

                case 'before':
                case 'after':
                    $varkey = array_keys($this->data['css'][$location],$file);
                    if($varkey){
                        $nextkey = ($key=='after') ? $varkey[0]+1 : $varkey[0];
                        array_splice($this->data['css'][$location],$nextkey,0,$css);
                    }else{
                        $this->data['css'][$location][]=$css;
                    }
                break;
            }
        }
    }
protected function loadCss($css, $options=array())
    {
        $location = (isset($options['location'])) ? $options['location']:'internal';

        //after:file, before:file, first, last
        $position = (isset($options['position'])) ? $options['position']:'last';

        if(!in_array($css,$this->data['css'][$location])){
            if($position=='first' || $position=='last'){
                $key = $position;
                $file='';
            }else{
                list($key,$file) =  explode(':',$position);
            }

            switch($key){
                case 'first':
                    array_unshift($this->data['css'][$location],$css);
                break;

                case 'last':
                    $this->data['css'][$location][]=$css;
                break;

                case 'before':
                case 'after':
                    $varkey = array_keys($this->data['css'][$location],$file);
                    if($varkey){
                        $nextkey = ($key=='after') ? $varkey[0]+1 : $varkey[0];
                        array_splice($this->data['css'][$location],$nextkey,0,$css);
                    }else{
                        $this->data['css'][$location][]=$css;
                    }
                break;
            }
        }
    }
protected function loadCss ( $ css , $ options = array ( ) ) { $ location = ( isset ( $ options [ 'location' ] ) ) ? $ options [ 'location' ] : 'internal' ; //after:file, before:file, first, last $ position = ( isset ( $ options [ 'position' ] ) ) ? $ options [ 'position' ] : 'last' ; if ( ! in_array ( $ css , $ this -> data [ 'css' ] [ $ location ] ) ) { if ( $ position == 'first' || $ position == 'last' ) { $ key = $ position ; $ file = '' ; } else { list ( $ key , $ file ) = explode ( ':' , $ position ) ; } switch ( $ key ) { case 'first' : array_unshift ( $ this -> data [ 'css' ] [ $ location ] , $ css ) ; break ; case 'last' : $ this -> data [ 'css' ] [ $ location ] [ ] = $ css ; break ; case 'before' : case 'after' : $ varkey = array_keys ( $ this -> data [ 'css' ] [ $ location ] , $ file ) ; if ( $ varkey ) { $ nextkey = ( $ key == 'after' ) ? $ varkey [ 0 ] + 1 : $ varkey [ 0 ] ; array_splice ( $ this -> data [ 'css' ] [ $ location ] , $ nextkey , 0 , $ css ) ; } else { $ this -> data [ 'css' ] [ $ location ] [ ] = $ css ; } break ; } } }
enqueue css asset to be loaded
@param  [string] $css     [css file to be loaded relative to base_asset_dir]
@param  [array]  $options [location=internal|external, position=first|last|after:file|before:file]
enqueue css asset to be loaded