Tokens
extends AutoService
in package
implements
EventSubscriberInterface
Every afform with the property `is_token=true` should have a corresponding set of tokens, `{afform.myFormLoginUrl}` and `{afform.myFormLoginLink}`.
Tags
Table of Contents
Interfaces
- EventSubscriberInterface
Properties
- $oldPrefix : string
- For compatibility with message-templates generated before 5.79, we also support notation `{afform.myFormUrl}`.
- $placement : mixed
- $prefix : string
- Token-picker recommends the notation `{login.myFormUrl}`
Methods
- applyCkeditorWorkaround() : mixed
- CKEditor makes it hard to set an `href` to a token, so we often get this munged `'http://{token}` data.
- createUrl() : string
- Generate an authenticated URL for viewing this form.
- evaluateTokens() : void
- Substitute any tokens of the form `{login.myFormUrl}` or `{login.myFormLink}` with actual values.
- getSubscribedEvents() : array<string|int, mixed>
- getTokenForms() : array<string|int, mixed>
- Get a list of forms that have token support enabled.
- listTokens() : void
Properties
$oldPrefix
For compatibility with message-templates generated before 5.79, we also support notation `{afform.myFormUrl}`.
private
static string
$oldPrefix
= 'afform'
$placement
private
static mixed
$placement
= 'msg_token'
$prefix
Token-picker recommends the notation `{login.myFormUrl}`
private
static string
$prefix
= 'login'
Methods
applyCkeditorWorkaround()
CKEditor makes it hard to set an `href` to a token, so we often get this munged `'http://{token}` data.
public
static applyCkeditorWorkaround(GenericHookEvent $e) : mixed
Parameters
- $e : GenericHookEvent
Tags
createUrl()
Generate an authenticated URL for viewing this form.
public
static createUrl(array<string|int, mixed> $afform, int $contactId) : string
Parameters
- $afform : array<string|int, mixed>
- $contactId : int
Tags
Return values
stringevaluateTokens()
Substitute any tokens of the form `{login.myFormUrl}` or `{login.myFormLink}` with actual values.
public
evaluateTokens(TokenValueEvent $e) : void
Parameters
- $e : TokenValueEvent
getSubscribedEvents()
public
static getSubscribedEvents() : array<string|int, mixed>
Return values
array<string|int, mixed>getTokenForms()
Get a list of forms that have token support enabled.
public
static getTokenForms() : array<string|int, mixed>
Return values
array<string|int, mixed> —$result[$formName] = ['name' => $formName, 'title' => $formTitle, 'server_route' => $route];
listTokens()
public
listTokens(TokenRegisterEvent $e) : void
Parameters
- $e : TokenRegisterEvent