Back to Document class

Method setLineEnd

public \Joomla\CMS\Document\Document
setLineEnd
(mixed $style)
Sets the line end style to Windows, Mac, Unix or a custom string.
Parameters
  • string $style "win", "mac", "unix" or custom string.
Returns
  • \Joomla\CMS\Document\Document instance of $this to allow chaining
Since
  • 1.7.0
Class: Document
Project: Joomla

Method setLineEnd - Source code

/**
 * Sets the line end style to Windows, Mac, Unix or a custom string.
 *
 * @param   string  $style  "win", "mac", "unix" or custom string.
 *
 * @return  Document instance of $this to allow chaining
 *
 * @since   1.7.0
 */
public function setLineEnd($style)
{
    switch ($style) {
        case 'win':
            $this->_lineEnd = "\r\n";
            break;
        case 'unix':
            $this->_lineEnd = "\n";
            break;
        case 'mac':
            $this->_lineEnd = "\r";
            break;
        default:
            $this->_lineEnd = $style;
    }
    return $this;
}