code/Utilities.php
public static function nl2p($string, $viewer) {
        $items = new \ArrayList();

        foreach(explode(PHP_EOL, $string) as $item) {
            if (trim($item)) {
                $items->push(new \ArrayData(array(
                    'line'	=> $item
                )));
            }
        }

        return $viewer->customise(new \ArrayData(array(
            'Paragraphs' => $items
        )))->renderWith('Paragraphs');
    }
public static function nl2p($string, $viewer) {
        $items = new \ArrayList();

        foreach(explode(PHP_EOL, $string) as $item) {
            if (trim($item)) {
                $items->push(new \ArrayData(array(
                    'line'	=> $item
                )));
            }
        }

        return $viewer->customise(new \ArrayData(array(
            'Paragraphs' => $items
        )))->renderWith('Paragraphs');
    }
public static function nl2p ( $ string , $ viewer ) { $ items = new \ ArrayList ( ) ; foreach ( explode ( PHP_EOL , $ string ) as $ item ) { if ( trim ( $ item ) ) { $ items -> push ( new \ ArrayData ( array ( 'line' => $ item ) ) ) ; } } return $ viewer -> customise ( new \ ArrayData ( array ( 'Paragraphs' => $ items ) ) ) -> renderWith ( 'Paragraphs' ) ; }
Take a string with new line feeds & create paragraphs.
Take a string with new line feeds & create paragraphs .