Moodle PHP Documentation 4.1
Moodle 4.1.19+ (Build: 20250711) (5f47dc23ffc)
Box\Spout\Writer\Common\Creator\WriterFactory Class Reference

Static Public Member Functions

static createFromFile (string $path)
 This creates an instance of the appropriate writer, given the extension of the file to be written.
 
static createFromType ($writerType)
 This creates an instance of the appropriate writer, given the type of the file to be written.
 

Member Function Documentation

◆ createFromFile()

static Box\Spout\Writer\Common\Creator\WriterFactory::createFromFile ( string $path)
static

This creates an instance of the appropriate writer, given the extension of the file to be written.

Parameters
string$pathThe path to the spreadsheet file. Supported extensions are .csv,.ods and .xlsx
Exceptions
Box\Spout\Common\Exception\UnsupportedTypeException
Return values
WriterInterface

◆ createFromType()

static Box\Spout\Writer\Common\Creator\WriterFactory::createFromType ( $writerType)
static

This creates an instance of the appropriate writer, given the type of the file to be written.

Parameters
string$writerTypeType of the writer to instantiate
Exceptions
Box\Spout\Common\Exception\UnsupportedTypeException
Return values
WriterInterface

The documentation for this class was generated from the following file: