Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
twig_tweak-3425472
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
twig_tweak-3425472
Commits
04a07da6
Commit
04a07da6
authored
3 years ago
by
Wilfred Waltman
Committed by
Ivan
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3188441
by seanB, Wilfred Waltman: Allow arguments to be passed to token_replace
parent
4bbf7f47
No related branches found
Tags
previous/3346754-fix-dialog-content/2023-03-12
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TwigTweakExtension.php
+11
-2
11 additions, 2 deletions
src/TwigTweakExtension.php
with
11 additions
and
2 deletions
src/TwigTweakExtension.php
+
11
−
2
View file @
04a07da6
...
...
@@ -434,12 +434,21 @@ class TwigTweakExtension extends AbstractExtension {
*
* @param string $text
* An HTML string containing replaceable tokens.
* @param array $data
* (optional) An array of keyed objects. For simple replacement scenarios
* 'node', 'user', and others are common keys, with an accompanying node or
* user object being the value. Some token types, like 'site', do not
* require any explicit information from $data and can be replaced even if
* it is empty.
* @param array $options
* (optional) A keyed array of settings and flags to control the token
* replacement process.
*
* @return string
* The entered HTML text with tokens replaced.
*/
public
static
function
tokenReplaceFilter
(
string
$text
):
string
{
return
\Drupal
::
token
()
->
replace
(
$text
);
public
static
function
tokenReplaceFilter
(
string
$text
,
array
$data
=
[],
array
$options
=
[]
):
string
{
return
\Drupal
::
token
()
->
replace
(
$text
,
$data
,
$options
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment