Utilities

Utilities

package

Docxpresso

subpackage

Core

Methods

generates an array from the attributes of a DOM element

attributes2Array(\Docxpresso\Commons\DOMNode $node) : array
static
access

public

static

Arguments

$node

\Docxpresso\Commons\DOMNode

Response

array

generates a file name from its path

cleanPath(string $path) : string
static
access

public

static

Arguments

$path

string

Response

string

gets a CSS property in arbitrary units and return a numeric value in the requested units

convertUnits(string $unit, string $prop) : float
static
access

public

static

Arguments

$unit

string

$prop

string

Response

float

Extracts the base URL from a http path

extractBaseURL(string $path) : string
static
access

public

static

Arguments

$path

string

Response

string

generates a random (quasi) unique id using uniqid

generateId(string $prefix = 'style_') : string
static
access

public

static

Arguments

$prefix

string

Response

string

builds a valid URL

generateURL(string $baseURL, string $path) : string
static
access

public

static

Arguments

$baseURL

string

$path

string

Response

string

fetch the background image ans return a local path

getBackgroundImage(string $path) : string
static
access

public

static

Arguments

$path

string

Response

string

Get the resolution of an image

getImgResolution(string $imageData, string $extension) : array
static
access

public

static

Arguments

$imageData

string

$extension

string

Response

array

Get the image size

getImgSize(string $imageData) : array
static
access

public

static

Arguments

$imageData

string

Response

array

Inserts a DOM node as first child of a given node

insertAsFirstChild(\Docxpresso\Commons\DOMNode $node, \Docxpresso\Commons\DOMNode $child) : array
static
access

public

static

Arguments

$node

\Docxpresso\Commons\DOMNode

the receptor node

$child

\Docxpresso\Commons\DOMNode

the node we wish to insert

Response

array

Checks if a string contains HTML code

isHTML(string $string) : boolean
static
access

public

static

Arguments

$string

string

Response

boolean

Get the resolution of an jpg|jpeg image in dots per inch

jpgResolution(string $imageData) : array
static
access

public

static

Arguments

$imageData

string

Response

array

Multiplies two give matrices

matrixMultiplication(array $matrix_1, array $matrix_2) : array
static
access

public

static

Arguments

$matrix_1

array

$matrix_2

array

Response

array

Get the resolution of an png image in dots per inch

pngResolution(string $imageData) : array
static
access

public

static

Arguments

$imageData

string

Response

array

updates the value of a DOMNode

updateNodeValue(string $nodeName, string $value, \Docxpresso\Commons\DOMNode $parentNode) : void
static
access

public

static

Arguments

$nodeName

string

the name of the node we want to update

$value

string

$parentNode

\Docxpresso\Commons\DOMNode

the parent node of the updated node

Checks if a string is UTF-8 encoded

UTF8Encoded(string $str) : boolean
static
access

public

static

Arguments

$str

string

Response

boolean