[ Index ]

PHP Cross Reference of phpBB-3.3.5-deutsch

title

Body

[close]

/vendor/s9e/text-formatter/src/Configurator/Helpers/ -> TemplateModifier.php (summary)

(no description)

Copyright: Copyright (c) 2010-2021 The s9e authors
License: http://www.opensource.org/licenses/mit-license.php The MIT License
File Size: 164 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 4 functions

  replaceTokens()
  createReplacementNode()
  replaceTokensInAttribute()
  replaceTokensInText()

Functions
Functions that are not part of a class:

replaceTokens($template, $regexp, $fn)   X-Ref
Replace parts of a template that match given regexp

Treats attribute values as plain text. Replacements within XPath expression is unsupported.
The callback must return an array with two elements. The first must be either of 'expression',
'literal' or 'passthrough', and the second element depends on the first.

- 'expression' indicates that the replacement must be treated as an XPath expression such as
'@foo', which must be passed as the second element.

- 'literal' indicates a literal (plain text) replacement, passed as its second element.

- 'passthrough' indicates that the replacement should the tag's content. It works differently
whether it is inside an attribute's value or a text node. Within an attribute's value, the
replacement will be the text content of the tag. Within a text node, the replacement
becomes an <xsl:apply-templates/> node. A second optional argument can be passed to be used
as its @select node-set.

param: string   $template Original template
param: string   $regexp   Regexp for matching parts that need replacement
param: callback $fn       Callback used to get the replacement
return: string             Processed template

createReplacementNode(DOMDocument $dom, array $replacement)   X-Ref
Create a node that implements given replacement strategy

param: DOMDocument $dom
param: array       $replacement
return: DOMNode

replaceTokensInAttribute(DOMAttr $attribute, $regexp, $fn)   X-Ref
Replace parts of an attribute that match given regexp

param: DOMAttr  $attribute Attribute
param: string   $regexp    Regexp for matching parts that need replacement
param: callback $fn        Callback used to get the replacement
return: void

replaceTokensInText(DOMText $node, $regexp, $fn)   X-Ref
No description



Generated: Mon Oct 4 17:42:11 2021 Cross-referenced by PHPXref 0.7.1