public function index($dirId=null)
    {

        if ($dirId == 'index') {
            $dirId = NULL;
        }

        $parentDir = NULL;

        $params = $this->getPassThruParams();

        $dir = $this->getDirectory($dirId);

        if ( isset($params['type']) && $params['type'] == 'image') {
            $this->filterToImages($dir);
        }

        $this->sortChildren($dir);

        $viewParams = [
            'dir' => $dir,
            'parents' => $this->fileDB->getParents($dir),
            'params' => $params,
            'toRoute' => function ($action, $params=[]) {
                return $this->toRoute($action, $params);
             },
            'attributeSetter' => $this->getAttributeProvider($this->getContext())
        ];

        return View::make($this->getTemplate(), $viewParams);
    }
public function index($dirId=null)
    {

        if ($dirId == 'index') {
            $dirId = NULL;
        }

        $parentDir = NULL;

        $params = $this->getPassThruParams();

        $dir = $this->getDirectory($dirId);

        if ( isset($params['type']) && $params['type'] == 'image') {
            $this->filterToImages($dir);
        }

        $this->sortChildren($dir);

        $viewParams = [
            'dir' => $dir,
            'parents' => $this->fileDB->getParents($dir),
            'params' => $params,
            'toRoute' => function ($action, $params=[]) {
                return $this->toRoute($action, $params);
             },
            'attributeSetter' => $this->getAttributeProvider($this->getContext())
        ];

        return View::make($this->getTemplate(), $viewParams);
    }
public function index ( $ dirId = null ) { if ( $ dirId == 'index' ) { $ dirId = NULL ; } $ parentDir = NULL ; $ params = $ this -> getPassThruParams ( ) ; $ dir = $ this -> getDirectory ( $ dirId ) ; if ( isset ( $ params [ 'type' ] ) && $ params [ 'type' ] == 'image' ) { $ this -> filterToImages ( $ dir ) ; } $ this -> sortChildren ( $ dir ) ; $ viewParams = [ 'dir' => $ dir , 'parents' => $ this -> fileDB -> getParents ( $ dir ) , 'params' => $ params , 'toRoute' => function ( $ action , $ params = [ ] ) { return $ this -> toRoute ( $ action , $ params ) ; } , 'attributeSetter' => $ this -> getAttributeProvider ( $ this -> getContext ( ) ) ] ; return View :: make ( $ this -> getTemplate ( ) , $ viewParams ) ; }
List a directory or the root directory.

@param int $dirId (optional)

@return mixed
List a directory or the root directory .