- Basic Concepts
- Processing user interactions
- Nesting leaves
- Data Binding
- Building a blog
- View Bridges
- The model
- Handling Children
- Extending View Bridges
- Control Components
- What is a control?
- Text Controls
- Selection Controls
- The selection control pattern
- Standard Variants
- Attaching additional data
- Dynamically driving the available items
- File Uploads
- Building your own control
- Application Components
- What is an application component?
- Advanced Topics
- View Indexes
An Application Leaf is a building block for building common user interface elements in a web based application.
They are designed to inter-operate with each other in a loosely coupled way, augmenting each other by detecting and handling events as appropriate.
For example a
Table component will display a paged list of records, but by connecting it with
SearchPanel component that list can now be filtered by user inputs. Connect the
component to a
SearchPanelTabs component and now the search values can be changed by selecting
Application components are bound together in the hosting View by calling
one component while passing the other.
bindEventsWith() is symmetrical in that it doesn't matter
which way around you call it:
$a->bindEventsWith($b) is the same as
bindEventsWith() calls a protected method
bindEvents() on each Leaf, passing the other
as the argument.
bindEvents() will then discover if they can interoperate with the Leaf being bound and if so
attach event handlers to do so.
Note that bindEvents() should not use
instanceofto determine the type of object being passed. Each application component exists in it's own composer project and can't assume the project has access to those other classes. Instead look for the signature of certain public properties or methods existing - usually public event variables.