Phpxforms documentation

ExporterHtml extends Exporter
in package

Export to HTML file

Table of Contents

Constants

VERSION  = 0.87
UNITS  = 'pt'
XML_HEADER  = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"

Properties

$borderTypes  : array<string, string>
$defColor  : string
$defaultStyle  : array<string, mixed>
$fileName  : string
$sheets  : array<string|int, Sheet>
$styles  : array<string, mixed>

Methods

__construct()  : mixed
Set output file name
addSheet()  : void
Insert sheet, throws error if name exist
addStyle()  : void
Insert new content style
compile()  : string|null
Generate html code
convertSize()  : float
Convert between different measure systems
download()  : void
Create download content
getSheets()  : array<string|int, Sheet>
Return array of Sheet
getVersion()  : string
Return version
insertSheet()  : Sheet
Create new data sheet, if name already exist rename
setDefault()  : void
Set default style
xmlEntities()  : string
Convert XML entities
checkUniqueName()  : string
Check if chosen name is unique - if not change it
createTemp()  : string
Create a temporary file in the temporary
getCell()  : string
Get table cell
prepareBorder()  : array<string, mixed>
Convert border settings
getBorderStyle()  : array<string|int, string>
Format border style settings
getStyle()  : array<string|int, string>
Format cell style

Constants

XML_HEADER

protected string XML_HEADER = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"

Properties

$borderTypes

public static array<string, string> $borderTypes = ['left' => 'LEFT', 'right' => 'RIGHT', 'top' => 'TOP', 'bottom' => 'BOTTOM']

$defColor

public static string $defColor = '#000000'

$defaultStyle

protected array<string, mixed> $defaultStyle = []

$styles

protected array<string, mixed> $styles = []

Methods

__construct()

Set output file name

public __construct(string $fileName) : mixed
Parameters
$fileName : string

addSheet()

Insert sheet, throws error if name exist

public addSheet(Sheet $sheet) : void
Parameters
$sheet : Sheet
Tags
throws
InvalidArgumentException

addStyle()

Insert new content style

public addStyle(string $mark[, array<string, mixed> $font = [] ][, array<string, mixed> $cell = [] ][, int|null $height = null ]) : void
Parameters
$mark : string
$font : array<string, mixed> = []
$cell : array<string, mixed> = []
$height : int|null = null
Tags
throws
InvalidArgumentException

compile()

Generate html code

public compile() : string|null
Tags
throws
InvalidArgumentException
Return values
string|null

convertSize()

Convert between different measure systems

public static convertSize(string|float $num[, string $def = 'pt' ][, string|null $out = null ]) : float
Parameters
$num : string|float

Value

$def : string = 'pt'

Measure unit

$out : string|null = null

Measure unit

Tags
throws
InvalidArgumentException
Return values
float

download()

Create download content

public download() : void

getSheets()

Return array of Sheet

public getSheets() : array<string|int, Sheet>
Return values
array<string|int, Sheet>

getVersion()

Return version

public getVersion() : string
Return values
string

insertSheet()

Create new data sheet, if name already exist rename

public insertSheet([string $name = 'List' ]) : Sheet
Parameters
$name : string = 'List'
Return values
Sheet

setDefault()

Set default style

public setDefault([array<string, mixed> $font = [] ][, array<string, mixed> $cell = [] ][, int|null $height = null ]) : void
Parameters
$font : array<string, mixed> = []
$cell : array<string, mixed> = []
$height : int|null = null

xmlEntities()

Convert XML entities

public static xmlEntities(string|float|int|null $val) : string
Parameters
$val : string|float|int|null
Return values
string

checkUniqueName()

Check if chosen name is unique - if not change it

protected checkUniqueName(string $newName[, int $i = 0 ]) : string
Parameters
$newName : string
$i : int = 0
Return values
string

createTemp()

Create a temporary file in the temporary

protected createTemp() : string
Tags
throws
InvalidArgumentException
Return values
string

getCell()

Get table cell

protected getCell(string|float|int|null $val[, string|null $class = null ][, array<string, mixed>|null $col = null ]) : string
Parameters
$val : string|float|int|null
$class : string|null = null
$col : array<string, mixed>|null = null
Return values
string

prepareBorder()

Convert border settings

protected prepareBorder(array<string, mixed> $cell) : array<string, mixed>
Parameters
$cell : array<string, mixed>
Return values
array<string, mixed>

getBorderStyle()

Format border style settings

private getBorderStyle(array<string|int, string> $data, string $side[, array<string, mixed> $style = null ]) : array<string|int, string>
Parameters
$data : array<string|int, string>
$side : string
$style : array<string, mixed> = null
Return values
array<string|int, string>

getStyle()

Format cell style

private getStyle(array<string, mixed> $style) : array<string|int, string>
Parameters
$style : array<string, mixed>
Return values
array<string|int, string>

        
On this page

Search results