Copied!

A container class that conforms to an interface needed by PHPFUI. The Container class does not impart any html or other formatting, but simply contains items that will be output in the order they were added to the collection.

CloneableInstantiable
Methods
public __construct()
 

Construct a Container. Any arguments passed to the constructor will be added to the container.

public __toString() : string
public add(PHPFUI\Base|string $object) : static
 

Add an item to the Container

  • param string|\Base $object need to support output interface or __toString
public addAsFirst(?mixed $object) : static
 

Adds to the front of the container

  • param mixed $object should be convertable to string
public count() : int
 

Supports the Countable interface

public prepend(PHPFUI\Base|string $object) : PHPFUI\Container
 

Add an item to the beginning of the Container

  • param string|\Base $object need to support output interface or __toString
public walk(string $method, ?mixed $argument = NULL) : static
 

Recursively walks all objects and calls the passed method on each object where it exists

  • param string $method to call on the object in the collection
  • param mixed $argument to pass to the method
Properties
private array $items = []
 
  • var array
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration