No description
  • PHP 83.9%
  • Scheme 16.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-09-24 12:24:46 +02:00
src Update TextFormatter.php 2024-09-24 12:11:43 +02:00
templates init 2024-09-24 11:59:15 +02:00
_config.php init 2024-09-24 11:59:15 +02:00
composer.json init 2024-09-24 11:59:15 +02:00
README.md Update README.md 2024-09-24 12:24:46 +02:00

silverstripe-textformatter

This module can be used to format text in default textfields by adding specific tags in between the text to style it in a custom way. The formatter will replace the text with ex. -Tags or spans with a special class for color styles. Tags can also be fully customized via the "updateReplaceableTags" extension-hook.

How To use:

To display the Formatting hint in the CMS simply add this in you getCMSFields: $fields->dataFieldByName('Title')->setDescription(TextFormatter::getFormattingDescription());

To output the formatted Text in the Frontend you need a special function like this one:

public function FrontendTitle()
{
  return TextFormatter::formattedText($this->Title);
}

grafik

grafik