События

Become a Patron!

Events facilitate advanced front-end interactions such as data submission.

Обзор

Events are scripts that, when attached to pages, will trigger and carry out an action if certain conditions are met. Symphony’s built-in event editor facilitates the creation of front-end saving events, which transmit data to a section from the front end when a form is submitted (a commenting system is a good example). It is possible, however, to write other kinds of custom events using Symphony’s events API (forthcoming).

Filters can be attached to events to add additional conditions (e.g. only authors may trigger the event) or secondary actions (e.g. send an email when the event is triggered).

Использование

Events can be accessed in the Components view (Blueprints > Components).

Once an event has been created, the event editor will display instructions and sample code for enabling front-end submissions.

Events must be attached to pages in order to be enabled.

Детали

Редактор событий
— Редактор событий

Events are created and edited using Symphony’s event editor, a simple form with only three settings:

Параметр Описание Пример
Name Название события Save Comment
Source Раздел, в который событие сохранит данные Comments
Filter Rules Фильтры события Send Email

Общая картина

Basic events are instrumental in enabling user interaction on the front end. Custom events have a broader scope, however, because anything scriptable in PHP can be triggered during page execution. Events can be provided by extensions.


Оригинал статьи

Symphony Team
http://getsymphony.com/learn/concepts/view/events/