namespace \webfiori\ui
class HeadNode
Class Attributes Summary
Class Methods Summary
Class Attributes Details
- base
- title
- meta
- link
- script
- noscript
- #COMMENT
- style
Class Methods Details
Creates new HTML node that represents head tag of HTML document. Note that by default, the node will have the following nodes in its body:
- A meta tag with "name"="viewport" and "content"="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
- A title tag.
Parameters:
Parameters:
- string $url The link to the alternate page. Must be non-empty string.
- string $lang The language of the page. Must be non-empty string.
- array $otherAttrs An associative array of additional attributes to set for the node. The indices are the names of attributes and the value of each index is the value of the attribute. Also, the array can only have attribute name if its empty attribute. Default is empty array.
Parameters:
- string $href The link to the file. Must be non empty string. It is possible to append query string to the end of the link.
- $otherAttrs An associative array of additional attributes to set for the node. The indices are the names of attributes and the value of each index is the value of the attribute. Also, the array can only have attribute name if its empty attribute. One special attribute is 'revision'. If this attribute is set to true, a string in the form '?cv=xxxxxxxxxx' will be appended to the 'href' attribute value. It is used to invalidate browser cache. This one can be also a string that represents the version of CSS file. Default is false. 'cv' = CSS Version. Default is empty array.
Parameters:
- HTMLNode $node The node that will be added. The node will be added only if the following conditions are met:
- It must be not a 'title' or 'base' node.
- It is a 'link' node but 'rel' attribute is not 'canonical'.
- It is a 'script' or 'noscript' node.
- It is a 'meta' node which is not added before.
- It is a '#COMMENT' node.
- array|boolean $attrs Not used if array is given. If boolean is given, it will be treated as last method argument.
- boolean $chainOnParent If this parameter is set to true, the method will return the same instance at which the child node is added to. If set to false, the method will return the child which have been added. This can be useful if the developer would like to add a chain of elements to the body of the parent or child. Default value is true. It means the chaining will happen at parent level.
$chainOnParent
is set to true, the method will return the '$this' instance. If set to false, it will return the newly added child. Note that if no child is added, the method will return null.Parameters:
- string $loc The location of the file. Must be non-empty string. It can have query string at the end.
- $otherAttrs An associative array of additional attributes to set for the node. The indices are the names of attributes and the value of each index is the value of the attribute. Also, the array can only have attribute name if its empty attribute. One special attribute is 'revision'. If the attribute is set to true, a string in the form '?jv=xxxxxxxxxx' will be appended to the 'src' attribute value. It is used to invalidate browser cache. This also can be a string that represents the version of the file. 'jv' = JavaScript Version. Default is empty array.
Parameters:
Parameters:
- string $name The value of the property 'name'. Must be non empty string.
- string $content The value of the property 'content'.
- boolean $override A boolean attribute. If a meta node was found which has the given name and this attribute is set to true, the content of the meta will be overridden by the passed value.
Parameters:
- string $name The value of the attribute 'name' of the meta tag. Note that if the meta node that you would like to get is the tag which has the attribute 'charset', then the passed attribute must have the value 'charset'.
Parameters:
- string $loc The value of the attribute 'href' of the CSS node.
Parameters:
- string $src The value of the attribute 'src' of the script node.
Parameters:
- string $name The value of the attribute 'name' of the meta tag. If the developer would like to check for the existence of the node which has the attribute 'charset', he can pass the value 'charset'.
Parameters:
Parameters:
Parameters:
Parameters: