public function all(PageInterface $current = null)
    {
        $all = new Collection();

        /** @var PageInterface $current */
        $current = $current ?: $this->root();

        if (!$current->root()) {
            $all[$current->path()] = ['slug' => $current->slug()];
        }

        foreach ($current->children() as $next) {
            $all->append($this->all($next));
        }

        return $all;
    }
public function all(PageInterface $current = null)
    {
        $all = new Collection();

        /** @var PageInterface $current */
        $current = $current ?: $this->root();

        if (!$current->root()) {
            $all[$current->path()] = ['slug' => $current->slug()];
        }

        foreach ($current->children() as $next) {
            $all->append($this->all($next));
        }

        return $all;
    }
public function all ( PageInterface $ current = null ) { $ all = new Collection ( ) ; /** @var PageInterface $current */ $ current = $ current ? : $ this -> root ( ) ; if ( ! $ current -> root ( ) ) { $ all [ $ current -> path ( ) ] = [ 'slug' => $ current -> slug ( ) ] ; } foreach ( $ current -> children ( ) as $ next ) { $ all -> append ( $ this -> all ( $ next ) ) ; } return $ all ; }
Get all pages

@param PageInterface $current

@return \Grav\Common\Page\Collection
Get all pages