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);
    }