Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Attributes | List of all members
MoodleExcelWorkbook Class Reference

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

Public Member Functions

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

Protected Attributes

string $filename
 
PhpSpreadsheet $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: