Phpxforms documentation

Exporter
in package

AbstractYes

Simple XLSX/ODS/HTML table exporter XLSX and ODS require ZipArchive class

basic style support for: $font -[ COLOR, SIZE, FAMILY, WEIGHT, ALIGN ] $cell (possible LEFT, RIGHT, TOP, BOTTOM) - [ BACKGROUND, COLOR, WIDTH, STYLE ]

Tags
author

DaVee8k

license

Lesser General Public License 2.1 or later; see http://www.gnu.org/licenses/lgpl-2.1.html

version
0.87dev

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
Build and print(plain text) or return(link on zip file) content
convertSize()  : float
Convert between different measure systems
download()  : void
Download file
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
prepareBorder()  : array<string, mixed>
Convert border settings

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()

Build and print(plain text) or return(link on zip file) content

public abstract compile() : string|null
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()

Download file

public abstract 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

prepareBorder()

Convert border settings

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

        
On this page

Search results