browser.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
This script contains some basic functions to assist the creation of stylesheets.
For instance, it can provide an abstraction layer regarding the various browser's versions, since the passed attributes can be interpolated by the PHP functions
Package
browser.php  
Todo
implement the various "abstraction layers" to specific (browser-related) css properties  

Functions

function__css__(array $array) : void

This function records the css attributes of selector or list of selectors (tags, classes and so on) for a further elaboration and use

Parameters
NameTypeDescription
$arrayarray

A multidimensional array with selectors (or list of selectors) as keys, and an array of attributes / values as values

Details
Package
browser.php  
function__css__render() : void

A function to render the css declarations recorded using the function __css__

Details
Package
browser.php  
function__px__(integer $px) : string

This function is used to scale the measures expressed in pixels in a similar way the zoom function of the browser does: everything is scaled, both text and images.

Parameters
NameTypeDescription
$pxinteger

Value expressed in pixels

Returns
TypeDescription
stringInterpolated pixel value with suffix 'px'
Details
Package
browser.php  
functionobj(array $obj) : void

A function by which calling the class Obj without the use of the 'new' operator

Parameters
NameTypeDescription
$objarray

The class argument of the new instance of Obj_

Details
Package
browser.php  
functionstr(string $str) : void

A function by which calling the class Str without the use of the 'new' operator

Parameters
NameTypeDescription
$strstring

The class argument of the new instance of Str_

Details
Package
browser.php  

\Obj_

Package: browser.php
A simple class to handle arrays in the method chaining (fluent interface style) and to group array-related functions

Properties

>VPropertyprivatearray $obj = array()

The class argument assigned by the constructor

Default valuearray()Details
Type
array

Methods

methodpublic__construct(array $obj) : \Obj_

Assigns the class argument ($this->obj)

Parameters
NameTypeDescription
$objarray

An associative array to be used as class argument

Returns
TypeDescription
\Obj_Returns the class instance
Details
Fluent
This method is part of a fluent interface and will return the same instance  
methodpublicimplode_map(string $tok_a, string $tok_b) : callable

A simple function to "implode" a single-dimension associative array

Parameters
NameTypeDescription
$tok_astring

The token to be used to join the key and the value

$tok_bstring

The token to be used to join key / value pairs

Returns
TypeDescription
callableReturns an instance of the class Str (documented above)

\Str_

Package: browser.php
A compacted form of the Str class which can be found in sf.php We only use it to return a string when an array is converted into it

Properties

>VPropertyprivateboolean $is_array = false

Records if the parameter passed to the constructor is an array, to provide the expected output when the get() method is called

Default valuefalseDetails
Type
boolean
>VPropertyprivatearray $str_array = array()

An array of strings. This is the "class argument" assigned by the constructor

Default valuearray()Details
Type
array

Methods

methodpublic__construct(string | array $mixed) : \Str_

The class constructor. We allow both single strings and array of strings to which perform any method of the class

Parameters
NameTypeDescription
$mixedstring | array

A string or an array of strings

Returns
TypeDescription
\Str_Returns the class instance
Details
Fluent
This method is part of a fluent interface and will return the same instance  
methodpublicget() : mixed

Gets the transformed class argument

Returns
TypeDescription
mixedA string of an array of strings depending on the value of $this->is_array
Documentation was generated by phpDocumentor 2.8.5.