Topics

Placeholders

ImpressPages provides ipReplacePlaceholders function to help you implement placeholders functionality in your plugin.

Example

<?php
$text = 'xxx {name} xxx';
$text = ipReplacePlaceholders($text, 'MyPlugin', array('name' => 'Leonardo da Vinci'));
echo $text; //Will output: xxx Leonardo da Vinci xxx
?>

This way you can use not only placeholders introduced by, you, but also by other plugins. By default ImpressPages brings following placeholders:

  • websiteTitle
  • websiteEmail
  • websiteUrl
  • userId
  • userEmail
  • userName

Any plugin can add its own globally accessible placeholders by catching filter ipReplacePlaceholdersValues and adding its own replacements.

comments powered by Disqus