mirror of
https://github.com/getgrav/grav.git
synced 2025-12-05 15:29:57 +01:00
committed by
Matias Griese
parent
2866a51326
commit
c57a29c23f
@@ -145,6 +145,18 @@ class Collection extends Iterator implements PageCollectionInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set current page.
|
||||
*/
|
||||
public function setCurrent(string $path): void
|
||||
{
|
||||
reset($this->items);
|
||||
|
||||
while (key($this->items) !== $path && key($this->items) !== null) {
|
||||
next($this->items);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns current page.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user