Menu

EventExpression

Jan Volf

Event Expression

PXML event expressions are expressions defined as attribute value for component's element in PXML, where the attribute name matches to any of the event type of events dispatched by the component.

Example:

<px:component xmlns:h="http://www.w3.org/1999/xhtml" xmlns:px="http://pexeso-php.sourceforge.net/1.0"
    viewCreated="{$this->viewCreatedHandler($event)}">
...

These rules applies to event expressions:

  • they are evaluated at the moment the event is dispatched
  • the value returned by the expression is ignored
  • the variable $event in the scope of the expression holds reference to event object dispatched by the component

Note: Binding other events that do not inherit from px\events\ExecuteEvent may result in unexpected behavior as only events inheriting from ExecuteEvent are dispatched in execute stage of the view (asynchronously). The other events are dispatched synchronously (at the moment the cause of event occurred) and if it happens in the aother stages of the view some components or properties may not be created or initialized or may not have expected value.


Related

Wiki: Expressions
Wiki: Home

MongoDB Logo MongoDB