Documentation

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
service

civi.afformLoginTokens.tokens

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
see
CRM_Utils_Hook::alterMailContent

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
throws
CryptoException
Return values
string

evaluateTokens()

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];


        
On this page

Search results