Applications
The following PHP script provides an example:
<?php $x = '[(#TEXTE|texte_script)]'; ?>
Attention: make sure to use the ’ (simple quote) character and not the " (double quote) character to delimit your PHP variable. In fact, if you used the double quote and your text contained the $ sign, the result could be quite catastrophic (partial display, display of something else, PHP crashing, etc.).
JS in a template (transmit a language string)
<script>
jQuery(function($) {
…
allDayHtml:'<:organiseur:cal_jour_entier|texte_script:>',
…
</script>
Applied to a tag in an HTML template, unrelated to a JS or PHP script, this filter simply resorts to escaping any apostrophe in the text, e.g. Daniel\'s new car
.
Voir aussi
On Programmer.spip.net