• PHP reference
  • Interface

ComponentController

class Core\Controller\Component\ComponentController

Component controller, which collects and processes dependencies for all components, and packages their JS and CSS in a single resource.

The Component controller is available as property components on a Controller instance, or within modules as $this->components in the root scope of the module controller.

Properties

string $url

Methods

__construct()

ComponentController constructor.

ComponentController add(string $name, string $dir = null, string $publicDir = null)

Load a component.

Parameters

  • string $name the name of the component to load
  • string $dir optionally overwrite the directory to load the component from
  • string $publicDir HTTP accessible URL path to serve the component from. Usually starts with a slash.

Return Value

ComponentController clear()

Clear added components.

Return Value