moritz-sauer-13/textformatter

该包最新版本(0.1.1)没有提供许可信息。

文本格式化扩展,用于在CMS中格式化普通文本

0.1.1 2024-09-24 10:11 UTC

This package is auto-updated.

Last update: 2024-09-24 10:24:49 UTC


README

本模块可用于通过在文本中添加特定标签来自定义格式化默认文本字段。格式化器将替换文本,例如使用-标签或具有特殊类的span进行颜色样式。也可以通过“updateReplaceableTags”扩展钩子完全自定义标签。

如何使用

要在CMS中显示格式化提示,请简单地在你的getCMSFields中添加以下代码:$fields->dataFieldByName('Title')->setDescription(TextFormatter::getFormattingDescription());

要在前端输出格式化文本,你需要一个特殊函数,如下所示

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

grafik

grafik