FluentDOM
[ class tree: FluentDOM ] [ index: FluentDOM ] [ all elements ]

Class: FluentDOMStyle

Source Location: /FluentDOM/Style.php

Class Overview

FluentDOMCore
   |
   --FluentDOM
      |
      --FluentDOMStyle

FluentDOMStyle extends the FluentDOM class with a function to edit the style attribute of html tags


Constants

Methods


Inherited Variables

Inherited Methods

Class: FluentDOM

FluentDOM::add()
Adds more elements, matched by the given expression, to the set of matched elements.
FluentDOM::addClass()
Adds the specified class(es) to each of the set of matched elements.
FluentDOM::after()
Insert content after each of the matched elements.
FluentDOM::andSelf()
Add the previous selection to the current selection.
FluentDOM::append()
Append content to the inside of every matched element.
FluentDOM::appendTo()
Append all of the matched elements to another, specified, set of elements.
FluentDOM::attr()
Access a property on the first matched element or set the attribute(s) of all matched elements
FluentDOM::before()
Insert content before each of the matched elements.
FluentDOM::children()
Get a set of elements containing of the unique immediate childnodes including only elements (not textnodes) of each of the matched set of elements.
FluentDOM::closest()
Get a set of elements containing the closest parent element that matches the specified selector, the starting element included.
FluentDOM::contents()
Get a set of elements containing all of the unique immediate childnodes including elements and textnodes of each of the matched set of elements.
FluentDOM::each()
Execute a function within the context of every matched element.
FluentDOM::end()
Revert the most recent traversing operation, changing the set of matched elements to its previous state.
FluentDOM::eq()
Reduce the set of matched elements to a single element.
FluentDOM::filter()
Removes all elements from the set of matched elements that do not match the specified expression(s).
FluentDOM::find()
Searches for descendent elements that match the specified expression.
FluentDOM::first()
Get a set of elements containing only the first of the currently selected elements.
FluentDOM::get()
Retrieve the matched DOM elements in an array. A negative position will be counted from the end.
FluentDOM::has()
Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
FluentDOM::hasClass()
Returns true if the specified class is present on at least one of the set of matched elements.
FluentDOM::index()
Search for a given element from among the matched elements.
FluentDOM::insertAfter()
Insert all of the matched elements after another, specified, set of elements.
FluentDOM::insertBefore()
Insert all of the matched elements before another, specified, set of elements.
FluentDOM::is()
Checks the current selection against an expression and returns true, if at least one element of the selection fits the given expression.
FluentDOM::last()
Get a set of elements containing only the last of the currently selected elements.
FluentDOM::map()
Translate a set of elements in the FluentDOM object into another set of values in an array (which may, or may not contain elements).
FluentDOM::next()
Get a set of elements containing the unique next siblings of each of the given set of elements.
FluentDOM::nextAll()
Find all sibling elements after the current element.
FluentDOM::nextUntil()
Get all following siblings of each element up to but not including the element matched by the selector.
FluentDOM::not()
Removes elements matching the specified expression from the set of matched elements.
FluentDOM::parent()
Get a set of elements containing the unique parents of the matched set of elements.
FluentDOM::parents()
Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
FluentDOM::parentsUntil()
Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector.
FluentDOM::prepend()
Prepend content to the inside of every matched element.
FluentDOM::prependTo()
Prepend all of the matched elements to another, specified, set of elements.
FluentDOM::prev()
Get a set of elements containing the unique previous siblings of each of the matched set of elements.
FluentDOM::prevAll()
Find all sibling elements in front of the current element.
FluentDOM::prevUntil()
Get all preceding siblings of each element up to but not including the element matched by the selector.
FluentDOM::remove()
Removes all matched elements from the DOM.
FluentDOM::removeAttr()
Remove an attribute from each of the matched elements.
FluentDOM::removeClass()
Removes all or the specified class(es) from the set of matched elements.
FluentDOM::replaceAll()
Replaces the elements matched by the specified selector with the matched elements.
FluentDOM::replaceWith()
Replaces all matched elements with the specified HTML or DOM elements.
FluentDOM::siblings()
Get a set of elements containing all of the unique siblings of each of the matched set of elements.
FluentDOM::slice()
Selects a subset of the matched elements.
FluentDOM::text()
Get the combined text contents of all matched elements or set the text contents of all matched elements.
FluentDOM::toArray()
Retrieve the matched DOM elements in an array.
FluentDOM::toggleClass()
Adds the specified class if the switch is TRUE, removes the specified class if the switch is FALSE, toggles the specified class if the switch is NULL.
FluentDOM::wrap()
Wrap each matched element with the specified content.
FluentDOM::wrapAll()
Wrap al matched elements with the specified content
FluentDOM::wrapInner()
Wrap the inner child contents of each matched element (including text nodes) with an XML structure.
FluentDOM::xml()
Get or set the xml contents of the first matched element.
FluentDOM::_cloneNodes()
Clone matched DOM Elements and select the clones.
FluentDOM::_emptyNodes()
Remove all child nodes from the set of matched elements.
FluentDOM::_wrap()
Wrap $content around a set of elements
FluentDOM::__call()
declaring an empty() or clone() method will crash the parser so we use some magic

Class: FluentDOMCore

FluentDOMCore::__construct()
Constructor
FluentDOMCore::count()
Get element count (Countable interface)
FluentDOMCore::evaluate()
Gives access to an xpath evaluate on the current document
FluentDOMCore::formatOutput()
Formats the current document, resets internal node array and other properties.
FluentDOMCore::getIterator()
Get an iterator for this object.
FluentDOMCore::item()
The item() method is used to access elements in the node list, like in a DOMNodelist.
FluentDOMCore::load()
Load a $source. The type of the source depends on the loaders. If no explicit loaders are set FluentDOM will use a set of default loaders for xml/html and DOM.
FluentDOMCore::namespaces()
Register namespaces and or get namespaces
FluentDOMCore::offsetExists()
Check if index exists in internal array
FluentDOMCore::offsetGet()
Get element from internal array
FluentDOMCore::offsetSet()
If somebody tries to modify the internal array throw an exception.
FluentDOMCore::offsetUnset()
If somebody tries to remove an element from the internal array throw an exception.
FluentDOMCore::push()
Push new element(s) an the internal element list
FluentDOMCore::setLoaders()
Define own loading handlers
FluentDOMCore::spawn()
Create a new instance of the same class with $this as the parent. This is used for the chaining.
FluentDOMCore::unique()
Sorts an array of DOM nodes based on document position, in place, with the duplicates removed.
FluentDOMCore::_applyContentToNodes()
Use a handler callback to apply a content argument to each node $targetNodes. The content argument can be an easy setter function
FluentDOMCore::_executeEasySetter()
Execute the easy setter function for a node and return the new elements
FluentDOMCore::_getContentElement()
Convert $content to a DOMElement. If $content contains several elements use the first.
FluentDOMCore::_getContentFragment()
Convert a given content xml string into and array of nodes
FluentDOMCore::_getContentNodes()
Convert a given content into and array of nodes
FluentDOMCore::_getContextNodes()
FluentDOMCore::_getHandler()
Get the class/object providing the handler functions
FluentDOMCore::_getInnerXml()
Get the inner xml of a given node or in other words the xml of all children.
FluentDOMCore::_getTargetNodes()
Get the target nodes from a given $selector.
FluentDOMCore::_initLoaders()
Initialize default loaders if they are not already initialized
FluentDOMCore::_inList()
Check if object is already in internal list
FluentDOMCore::_isCallback()
check if parameter is a valid callback function
FluentDOMCore::_isNCName()
Validate string as qualified node name part (namespace or local name)
FluentDOMCore::_isNode()
Check if the DOMNode is DOMElement or DOMText with content
FluentDOMCore::_isNodeList()
Check if $elements is a iterateable node list
FluentDOMCore::_isQName()
Validate string as qualified node name
FluentDOMCore::_match()
Match XPath expression agains context and return matched elements.
FluentDOMCore::_removeNodes()
Remove nodes from document tree
FluentDOMCore::_setContentType()
Setter for FluentDOM::_contentType property
FluentDOMCore::_test()
Test xpath expression against context and return true/false
FluentDOMCore::_uniqueSort()
Sorts the selected nodes, with the duplicates removed.
FluentDOMCore::_xpath()
Get a XPath object associated with the internal DOMDocument and register default namespaces from the document element if availiable.
FluentDOMCore::__get()
implement dynamic properties using magic methods
FluentDOMCore::__isset()
support isset for dynamic properties length and document
FluentDOMCore::__set()
block changes of dynamic readonly property length
FluentDOMCore::__toString()
Return the XML output of the internal dom document

Class Details

[line 41]
FluentDOMStyle extends the FluentDOM class with a function to edit the style attribute of html tags



[ Top ]


Class Methods


method css [line 55]

string|object FluentDOMStyle css( string|array $property, [NULL|string|object Closure $value = NULL])

get or set CSS values in style attributes



Tags:

access:  public


Parameters:

string|array   $property  
NULL|string|object Closure   $value  

[ Top ]

method _compareCSSProperties [line 195]

integer _compareCSSProperties( string $propertyNameOne, string $propertyNameTwo)

compare to css property names

by name, browser-prefix, level




Tags:

access:  private


Parameters:

string   $propertyNameOne  
string   $propertyNameTwo  

[ Top ]

method _decodeStyleAttribute [line 152]

array _decodeStyleAttribute( string $styleString)

decode style attribute to css properties array



Tags:

access:  private


Parameters:

string   $styleString  

[ Top ]

method _encodeStyleAttribute [line 175]

string _encodeStyleAttribute( array $properties)

encode css options array for the style string



Tags:

access:  private


Parameters:

array   $properties  

[ Top ]

method _getCSSPropertyElements [line 228]

array _getCSSPropertyElements( $propertyName)

decodes the css property name into an compareable array



Tags:

access:  private


Parameters:

   $propertyName  

[ Top ]

method _isCSSProperty [line 138]

boolean _isCSSProperty( string $propertyName)

check if string is an valid css property name



Tags:

access:  private


Parameters:

string   $propertyName  

[ Top ]


Class Constants

STYLE_PATTERN =  '((?:^|;)\s*(?P<name>[-\w]+)\s*:\s*(?P<value>[^;]+))'

[line 46]

Pattern to decode the stlye property string


[ Top ]



Documentation generated on Fri, 30 Jul 2010 01:00:56 +0200 by phpDocumentor 1.4.3