MIOLO25
Carregando...
Procurando...
Nenhuma entrada encontrada
Referência à classe Style

Membros públicos

 __construct (Stylesheet $stylesheet)
 
 dispose ()
 
 get_stylesheet ()
 
 length_in_pt ($length, $ref_size=null)
 
 inherit (Style $parent)
 
 merge (Style $style)
 
 munge_colour ($colour)
 
 munge_color ($color)
 
 __set ($prop, $val)
 
 __get ($prop)
 
 get_font_family ()
 
 get_font_size ()
 
 get_word_spacing ()
 
 get_line_height ()
 
 get_color ()
 
 get_background_color ()
 
 get_background_position ()
 
 get_border_top_color ()
 
 get_border_right_color ()
 
 get_border_bottom_color ()
 
 get_border_left_color ()
 
 get_border_top_width ()
 
 get_border_right_width ()
 
 get_border_bottom_width ()
 
 get_border_left_width ()
 
 get_border_properties ()
 
 get_border_top ()
 
 get_border_right ()
 
 get_border_bottom ()
 
 get_border_left ()
 
 get_border_spacing ()
 
 set_color ($colour)
 
 set_background_color ($colour)
 
 set_background_image ($val)
 
 set_font_size ($size)
 
 set_page_break_before ($break)
 
 set_page_break_after ($break)
 
 set_margin_top ($val)
 
 set_margin_right ($val)
 
 set_margin_bottom ($val)
 
 set_margin_left ($val)
 
 set_margin ($val)
 
 set_padding_top ($val)
 
 set_padding_right ($val)
 
 set_padding_bottom ($val)
 
 set_padding_left ($val)
 
 set_padding ($val)
 
 set_border_top ($val)
 
 set_border_right ($val)
 
 set_border_bottom ($val)
 
 set_border_left ($val)
 
 set_border ($val)
 
 set_border_width ($val)
 
 set_border_color ($val)
 
 set_border_style ($val)
 
 set_border_spacing ($val)
 
 set_list_style_image ($val)
 
 set_list_style ($val)
 
 __toString ()
 

Atributos Públicos Estáticos

static $default_font_size = 12
 
static $default_line_height = 1.2
 
static $INLINE_TYPES = array("inline")
 
static $BLOCK_TYPES = array("block","inline-block", "table-cell", "list-item")
 
static $TABLE_TYPES = array("table", "inline-table")
 
static $BORDER_STYLES
 

Membros protegidos

 _get_border ($side)
 
 _set_border ($side, $border_spec)
 

Atributos Protegidos

 $_stylesheet
 
 $_props
 
 $_prop_cache
 
 $_parent_font_size
 

Atributos Protegidos Estáticos

static $_defaults = null
 
static $_inherited = null
 

Documentação dos Construtores & Destrutor

◆ __construct()

__construct ( Stylesheet $stylesheet)

Class constructor

Parâmetros
Stylesheet$stylesheetthe stylesheet this Style is associated with.

Documentação das funções

◆ __get()

__get ( $prop)

PHP5 overloaded getter

Along with Style::__set() __get() provides access to all CSS properties directly. Typically __get() is not called directly outside of this class.

Parâmetros
string$prop
Retorna
mixed

◆ __set()

__set ( $prop,
$val )

PHP5 overloaded setter

This function along with Style::__get() permit a user of the Style class to access any (CSS) property using the following syntax: Style->margin_top = "1em"; echo (Style->margin_top);

__set() automatically calls the provided set function, if one exists, otherwise it sets the property directly. Typically, __set() is not called directly from outside of this class.

Parâmetros
string$propthe property to set
mixed$valthe value of the property

◆ __toString()

__toString ( )

Generate a string representation of the Style

This dumps the entire property array into a string via print_r. Useful for debugging.

Retorna
string

◆ _get_border()

_get_border ( $side)
protected

Return a single border property

Retorna
mixed

◆ _set_border()

_set_border ( $side,
$border_spec )
protected

#- Sets a single border

Parâmetros
string$side
string$border_spec([width] [style] [color])

◆ dispose()

dispose ( )

"Destructor": forcibly free all references held by this object

◆ get_background_color()

get_background_color ( )

Returns the background colour as an array

The returned array has the same format as Style::get_color()

array

◆ get_background_position()

get_background_position ( )

Returns the background position as an array

The returned array has the following format: array(x,y, "x" => x, "y" => y)

array

◆ get_border_bottom()

get_border_bottom ( )

◆ get_border_bottom_color()

get_border_bottom_color ( )

◆ get_border_bottom_width()

get_border_bottom_width ( )

◆ get_border_left()

get_border_left ( )

◆ get_border_left_color()

get_border_left_color ( )

◆ get_border_left_width()

get_border_left_width ( )

◆ get_border_properties()

get_border_properties ( )

#- Return an array of all border properties.

The returned array has the following structure: array("top" => array("width" => [border-width], "style" => [border-style], "color" => [border-color (array)]), "bottom" ... )

Retorna
array

◆ get_border_right()

get_border_right ( )

◆ get_border_right_color()

get_border_right_color ( )

◆ get_border_right_width()

get_border_right_width ( )

◆ get_border_spacing()

get_border_spacing ( )

#- Returns border spacing as an array

The array has the format (h_space,v_space)

array

◆ get_border_top()

get_border_top ( )

#+ Return full border properties as a string

Border properties are returned just as specified in CSS:

[width] [style] [color]

e.g. "1px solid blue"

string

◆ get_border_top_color()

get_border_top_color ( )

#+ Returns the border colour as an array

See Style::get_color()

array

◆ get_border_top_width()

get_border_top_width ( )

#- #+ Returns the border width, as it is currently stored

float|string

◆ get_color()

get_color ( )

Returns the colour as an array

The array has the following format: array(r,g,b, "r" => r, "g" => g, "b" => b, "hex" => "#rrggbb")

array

◆ get_font_family()

get_font_family ( )

Getter for the 'font-family' CSS property.

Uses the Font_Metrics class to resolve the font family into an actual font file.

string

◆ get_font_size()

get_font_size ( )

Returns the resolved font size, in points

http://www.w3.org/TR/CSS21/fonts.html#propdef-font-size

Retorna
float

◆ get_line_height()

get_line_height ( )

◆ get_stylesheet()

get_stylesheet ( )

returns the Stylesheet this Style is associated with.

Retorna
Stylesheet

◆ get_word_spacing()

get_word_spacing ( )

◆ inherit()

inherit ( Style $parent)

Set inherited properties in this style using values in $parent

Parâmetros
Style$parent

◆ length_in_pt()

length_in_pt ( $length,
$ref_size = null )

Converts any CSS length value into an absolute length in points.

length_in_pt() takes a single length (e.g. '1em') or an array of lengths and returns an absolute length. If an array is passed, then the return value is the sum of all elements.

If a reference size is not provided, the default font size is used (Style::$default_font_size).

Parâmetros
float | array$lengththe length or array of lengths to resolve
float$ref_sizean absolute reference size to resolve percentage lengths
Retorna
float

◆ merge()

merge ( Style $style)

Override properties in this style with those in $style

Parâmetros
Style$style

◆ munge_color()

munge_color ( $color)

Alias for Style::munge_colour()

Parâmetros
string$color
Retorna
array

◆ munge_colour()

munge_colour ( $colour)

Returns an array(r, g, b, "r"=> r, "g"=>g, "b"=>b, "hex"=>"#rrggbb") based on the provided CSS colour value.

Parâmetros
string$colour
Retorna
array

◆ set_background_color()

set_background_color ( $colour)

Sets the background colour

string $colour

◆ set_background_image()

set_background_image ( $val)

Set the background image url

string $url

◆ set_border()

set_border ( $val)

◆ set_border_bottom()

set_border_bottom ( $val)

◆ set_border_color()

set_border_color ( $val)

◆ set_border_left()

set_border_left ( $val)

◆ set_border_right()

set_border_right ( $val)

◆ set_border_spacing()

set_border_spacing ( $val)

#- Sets the border spacing

float $val

◆ set_border_style()

set_border_style ( $val)

◆ set_border_top()

set_border_top ( $val)

#+ Sets the border styles

string $val

◆ set_border_width()

set_border_width ( $val)

◆ set_color()

set_color ( $colour)

Sets colour

The colour parameter can be any valid CSS colour value

string $colour

◆ set_font_size()

set_font_size ( $size)

Sets the font size

$size can be any acceptable CSS size

string|float $size

◆ set_list_style()

set_list_style ( $val)

Sets the list style

This is not currently implemented

$val

◆ set_list_style_image()

set_list_style_image ( $val)

Sets the list style image

$val

◆ set_margin()

set_margin ( $val)

◆ set_margin_bottom()

set_margin_bottom ( $val)

◆ set_margin_left()

set_margin_left ( $val)

◆ set_margin_right()

set_margin_right ( $val)

◆ set_margin_top()

set_margin_top ( $val)

#- #+ Sets the margin size

$val

◆ set_padding()

set_padding ( $val)

◆ set_padding_bottom()

set_padding_bottom ( $val)

◆ set_padding_left()

set_padding_left ( $val)

◆ set_padding_right()

set_padding_right ( $val)

◆ set_padding_top()

set_padding_top ( $val)

#- #+ Sets the padding size

$val

◆ set_page_break_after()

set_page_break_after ( $break)

◆ set_page_break_before()

set_page_break_before ( $break)

#+ Sets page break properties

string $break

Documentação dos campos e atributos

◆ $_defaults

$_defaults = null
staticprotected

◆ $_inherited

$_inherited = null
staticprotected

◆ $_parent_font_size

$_parent_font_size
protected

◆ $_prop_cache

$_prop_cache
protected

◆ $_props

$_props
protected

◆ $_stylesheet

$_stylesheet
protected

◆ $BLOCK_TYPES

$BLOCK_TYPES = array("block","inline-block", "table-cell", "list-item")
static

◆ $BORDER_STYLES

$BORDER_STYLES
static
Valor inicial:
= array("none", "hidden", "dotted", "dashed", "solid",
"double", "groove", "ridge", "inset", "outset")

◆ $default_font_size

$default_font_size = 12
static

◆ $default_line_height

$default_line_height = 1.2
static

◆ $INLINE_TYPES

$INLINE_TYPES = array("inline")
static

◆ $TABLE_TYPES

$TABLE_TYPES = array("table", "inline-table")
static

A documentação para esta classe foi gerada a partir do seguinte ficheiro: