src/Lablog/Lablog/Category/FileCategory.php
public function getSubCategories($category)
    {
        $ds = DIRECTORY_SEPARATOR;
        $categoryPath = str_replace('/', $ds, $category);

        $basePath = app_path().$ds.'lablog'.$ds;

        $path = $basePath.$categoryPath;

        if (!$this->exists($category)) {
            return array();
        }

        $categories = $this->fs->directories($path);

        $allCategories = array();

        foreach ($categories as $category) {
            $cat = str_replace($basePath, '', $category);
            $allCategories[] = $this->getCategory($cat);
        }

        return $allCategories;
    }
public function getSubCategories($category)
    {
        $ds = DIRECTORY_SEPARATOR;
        $categoryPath = str_replace('/', $ds, $category);

        $basePath = app_path().$ds.'lablog'.$ds;

        $path = $basePath.$categoryPath;

        if (!$this->exists($category)) {
            return array();
        }

        $categories = $this->fs->directories($path);

        $allCategories = array();

        foreach ($categories as $category) {
            $cat = str_replace($basePath, '', $category);
            $allCategories[] = $this->getCategory($cat);
        }

        return $allCategories;
    }
public function getSubCategories ( $ category ) { $ ds = DIRECTORY_SEPARATOR ; $ categoryPath = str_replace ( '/' , $ ds , $ category ) ; $ basePath = app_path ( ) . $ ds . 'lablog' . $ ds ; $ path = $ basePath . $ categoryPath ; if ( ! $ this -> exists ( $ category ) ) { return array ( ) ; } $ categories = $ this -> fs -> directories ( $ path ) ; $ allCategories = array ( ) ; foreach ( $ categories as $ category ) { $ cat = str_replace ( $ basePath , '' , $ category ) ; $ allCategories [ ] = $ this -> getCategory ( $ cat ) ; } return $ allCategories ; }
Get a given categories sub categories.
@param  string $category
@return array
Get a given categories sub categories .