artabro/wire/modules/Textformatter/TextformatterNewlineBR.module

28 lines
558 B
Text
Raw Permalink Normal View History

2024-08-27 11:35:37 +02:00
<?php namespace ProcessWire;
/**
* ProcessWire Newlines to <br /> Textformatter
*
* Inserts <br /> tags automatically into newlines
*
* ProcessWire 3.x, Copyright 2016 by Ryan Cramer
* https://processwire.com
*
*
*/
class TextformatterNewlineBR extends Textformatter {
public static function getModuleInfo() {
return array(
'title' => 'Newlines to XHTML Line Breaks',
'version' => 100,
'summary' => "Converts newlines to XHTML line break <br /> tags. ",
);
}
public function format(&$str) {
$str = nl2br(trim($str));
}
}