Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
MoodleExcelWorkbook Class Reference

Define and operate over one Moodle Workbook. More...

Public Member Functions

 __construct ($filename, $type='Xlsx')
 Constructs one Moodle Workbook.
 
 add_format ($properties=array())
 Create one cell Format.
 
 add_worksheet ($name='')
 Create one Moodle Worksheet.
 
 close ()
 Close the Moodle Workbook.
 
 send ($filename)
 Not required to use.
 

Protected Attributes

string $filename
 
PhpOffice PhpSpreadsheet Spreadsheet $objspreadsheet
 
string $type
 format type
 

Detailed Description

Define and operate over one Moodle Workbook.

This class acts as a wrapper around another library maintaining Moodle functions isolated from underlying code.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

MoodleExcelWorkbook::__construct ( $filename,
$type = 'Xlsx' )

Constructs one Moodle Workbook.

Parameters
string$filenameThe name of the file
string$typefile format type used to be 'Xls or Xlsx' but now only 'Xlsx'

Member Function Documentation

◆ add_format()

MoodleExcelWorkbook::add_format ( $properties = array())

Create one cell Format.

Parameters
array$propertiesarray of properties [name]=value; valid names are set_XXXX existing functions without the set_ part i.e: [bold]=1 for set_bold(1)...Optional!
Return values
MoodleExcelFormat

◆ add_worksheet()

MoodleExcelWorkbook::add_worksheet ( $name = '')

Create one Moodle Worksheet.

Parameters
string$nameName of the sheet
Return values
MoodleExcelWorksheet

◆ send()

MoodleExcelWorkbook::send ( $filename)

Not required to use.

Parameters
string$filenameName of the downloaded file

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