Contents

System\Twig\SecurityPolicy\SafePaginator

Overview

SafePaginator proxies a paginator so that forwarded __call reaches the underlying collection through SafeCollection instead of the raw one.

Implements
  • October\Contracts\Twig\CallsAnyMethod
  • ArrayAccess
  • Countable
  • IteratorAggregate
  • Stringable
  • Traversable

Protected Properties

protected array $blockedMethods

blockedMethods that expose the raw collection, accept callables, or instantiate arbitrary classes

protected $paginator


Public Methods

public __call()

public __call($method, $parameters): void

__call routes native paginator methods to the paginator, otherwise routes the call through SafeCollection so the raw collection is never exposed.

public __construct()

public __construct($paginator): void

public __toString()

public __toString(): string 

__toString delegates to the paginator so string casts render pagination.

public count()

public count(): int 

count delegates to the paginator so Twig |length works.

public getIterator()

public getIterator(): Traversable 

getIterator delegates iteration to the paginator so Twig for-loops work.

public offsetExists()

public offsetExists($offset): bool 

offsetExists delegates to the paginator so Twig array access works.

public offsetGet()

public offsetGet($offset): mixed 

offsetGet delegates to the paginator so Twig array access works.

public offsetSet()

public offsetSet($offset, $value): void 

offsetSet is a no-op since paginators are read-only in Twig.

public offsetUnset()

public offsetUnset($offset): void 

offsetUnset is a no-op since paginators are read-only in Twig.