Warning: You are browsing the documentation from version 4 to 10 of Pimcore. Please visit https://pimcore.com/docs/platform/ for the latest versions of Pimcore.
Version:

Text Placeholder

The Text Placeholder is used to replace the placeholder with the passed value.

There is no config available for text placeholders.

Example Usage

public function textPlaceholderAction(){
     $this->disableViewAutoRender();
 
     $text = 'Hello %Text(firstName); %Text(lastName);!';
     $placeholder = new \Pimcore\Placeholder();
 
     $params = ['firstName' => 'Bart', 'lastName' => 'Simpson'];
 
     $replaced = $placeholder->replacePlaceholders($text, $params);
     echo $replaced; //Will be: Hello Bart Simpson!
}