Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

(no description)

File Size: 969 lines (32 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: Html  - X-Ref

__construct()   X-Ref
Create a new HTML Reader instance.


canRead($pFilename)   X-Ref
Validate that the current file is an HTML file.

param: string $pFilename
return: bool

readBeginning()   X-Ref
No description

readEnding()   X-Ref
No description

startsWithTag($data)   X-Ref
No description

endsWithTag($data)   X-Ref
No description

containsTags($data)   X-Ref
No description

load($pFilename)   X-Ref
Loads Spreadsheet from file.

param: string $pFilename
return: Spreadsheet

setInputEncoding($pValue)   X-Ref
Set input encoding.

param: string $pValue Input encoding, eg: 'ANSI'
return: Html

getInputEncoding()   X-Ref
Get input encoding.

return: string

setTableStartColumn($column)   X-Ref
No description

getTableStartColumn()   X-Ref
No description

releaseTableStartColumn()   X-Ref
No description

flushCell(Worksheet $sheet, $column, $row, &$cellContent)   X-Ref
No description

processDomElement(DOMNode $element, Worksheet $sheet, &$row, &$column, &$cellContent)   X-Ref

param: DOMNode $element
param: Worksheet $sheet
param: int $row
param: string $column
param: string $cellContent

loadIntoExisting($pFilename, Spreadsheet $spreadsheet)   X-Ref
Loads PhpSpreadsheet from file into PhpSpreadsheet instance.

param: string $pFilename
param: Spreadsheet $spreadsheet
return: Spreadsheet

loadFromString($content, ?Spreadsheet $spreadsheet = null)   X-Ref
Spreadsheet from content.

param: string $content
param: null|Spreadsheet $spreadsheet
return: Spreadsheet

loadDocument(DOMDocument $document, Spreadsheet $spreadsheet)   X-Ref
Loads PhpSpreadsheet from DOMDocument into PhpSpreadsheet instance.

param: DOMDocument $document
param: Spreadsheet $spreadsheet
return: Spreadsheet

getSheetIndex()   X-Ref
Get sheet index.

return: int

setSheetIndex($pValue)   X-Ref
Set sheet index.

param: int $pValue Sheet index
return: HTML

applyInlineStyle(&$sheet, $row, $column, $attributeArray)   X-Ref
Apply inline css inline style.

NOTES :
Currently only intended for td & th element,
and only takes 'background-color' and 'color'; property with HEX color

TODO :
- Implement to other propertie, such as border

param: Worksheet $sheet
param: int $row
param: string $column
param: array $attributeArray

getStyleColor($value)   X-Ref
Check if has #, so we can get clean hex.

param: $value
return: null|string

insertImage(Worksheet $sheet, $column, $row, array $attributes)   X-Ref

param: Worksheet $sheet
param: string    $column
param: int       $row
param: array     $attributes

getBorderStyle($style)   X-Ref
Map html border style to PhpSpreadsheet border style.

param: string $style
return: null|string

setBorderStyle(Style $cellStyle, $styleValue, $type)   X-Ref

param: Style  $cellStyle
param: string $styleValue
param: string $type