Skip to content

Update class.ilCSVWriter.php#11761

Open
phntxx wants to merge 1 commit into
ILIAS-eLearning:trunkfrom
phntxx:trunk
Open

Update class.ilCSVWriter.php#11761
phntxx wants to merge 1 commit into
ILIAS-eLearning:trunkfrom
phntxx:trunk

Conversation

@phntxx

@phntxx phntxx commented Jul 16, 2026

Copy link
Copy Markdown

This PR adds a couple of functions to class.ilCSVWriter.php:

  • setNewline(string $a_new) allows extending classes to modify the newline character(s) to use, which can prove helpful in some scenarios (e.g. if you require a carriage return (\r) and newline symbol (\n) at the end of a line).
  • withXYZ(...) functions allow for one-lined instantation of ilCSVWriter, see the following example.
// before
$writer = new ilCSVWriter();
$writer->setSeparator("a");
$writer->setDelimiter("b");

// after
$writer = new ilCSVWriter()->withSeparator("a")->withDelimiter("b");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant