Components

Classes that extend from View are called Components and inherit abilities to render themselves (see Render Tree)

Core Components

Some components serve as a foundation of entire set of other components. A lot of qualities implemented by a core component is inherited by its descendants.

Simple components

_images/simple.png

Simple components exist for the purpose of abstraction and creating a decent interface which you can rely on when programming your PHP application with Agile UI. In some cases it may make sense to rely on HTML templates for the simple elements such as Icons, but when you are working with dynamic and generic components quite often you need to abstract HTML yet let the user have decent control over even the small elements.

Interactive components

_images/interactive.png

Interactive components rely on Callbacks, VirtualPage or Server Sent Event (JsSse) to communicate with themselves in the PHP realm. You add them just as you would add any other component, yet they will send additional requests, like loading additional data or executing other code. Here is how interractive components will typically communicate:

  1. request by browser is made.
  2. App asks Console to render HTML+JavaScript.
  3. JavaScript invokes AJAX request using a Callback URL.
  4. Callback invokes user-defined PHP code, which will generate some Console::output().
  5. Response is encoded and
  6. sent back to the browser either as JSON or Server Sent Event (JsSse).

Composite components

_images/composite.png

Composite elements such as Grid are the bread-and-butter of Agile UI. They will pass on rendering and intractivity to several sub-components. Illustration shows how Grid relies on Table for rendering the data table, but Grid will also rely on Menu and Paginator when necessary.

Any component automatically becomes composite if, you use View::add().