protected function renderItems(array $items, $type, $sorted = true)
    {
        if ($sorted) {
            static::sortItems($items);
        }

        return array_map(function ($item) use ($type)
        {
            $asset = Arr::get($item, 'asset');

            //
            $mode = Arr::get($item, 'mode', 'default');

            if ($mode === 'inline') {
                $asset = sprintf("\n%s\n", trim($asset));
            }

            // The 'view' mode is a specialized 'inline'
            else if ($mode === 'view') {
                $mode = 'inline';

                $asset = $this->views->fetch($asset);
            }

            $template = Arr::get(static::$templates, "${mode}.${type}");

            return sprintf($template, $asset);

        }, $items);
    }
protected function renderItems(array $items, $type, $sorted = true)
    {
        if ($sorted) {
            static::sortItems($items);
        }

        return array_map(function ($item) use ($type)
        {
            $asset = Arr::get($item, 'asset');

            //
            $mode = Arr::get($item, 'mode', 'default');

            if ($mode === 'inline') {
                $asset = sprintf("\n%s\n", trim($asset));
            }

            // The 'view' mode is a specialized 'inline'
            else if ($mode === 'view') {
                $mode = 'inline';

                $asset = $this->views->fetch($asset);
            }

            $template = Arr::get(static::$templates, "${mode}.${type}");

            return sprintf($template, $asset);

        }, $items);
    }
protected function renderItems ( array $ items , $ type , $ sorted = true ) { if ( $ sorted ) { static :: sortItems ( $ items ) ; } return array_map ( function ( $ item ) use ( $ type ) { $ asset = Arr :: get ( $ item , 'asset' ) ; // $ mode = Arr :: get ( $ item , 'mode' , 'default' ) ; if ( $ mode === 'inline' ) { $ asset = sprintf ( "\n%s\n" , trim ( $ asset ) ) ; } // The 'view' mode is a specialized 'inline' else if ( $ mode === 'view' ) { $ mode = 'inline' ; $ asset = $ this -> views -> fetch ( $ asset ) ; } $ template = Arr :: get ( static :: $ templates , "${mode}.${type}" ) ; return sprintf ( $ template , $ asset ) ; } , $ items ) ; }
Render the given position items to an array of assets.

@param  array $items
@param string $type
@param bool $sorted

@return array
Render the given position items to an array of assets .