namespace \webfiori\ui
class HTMLDoc
Class Attributes Summary
Class Methods Summary
Class Attributes Details
Class Methods Details
Constructs a new HTML document. The document that will be generated will look like the following by default:
<!DOCTYPE html
Parameters:
- HTMLNode|string $node The node that will be added. It can be an instance of 'HTMLNode' or tag name. It will be added only if the name of the node is not 'html', 'head' or body.
- array $attributes An optional array of attributes which will be set in the newly added child.
- 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 false. It means the chaining will happen at parent level.
$chainOnParent
is set to true, the method will return the 'body' HTML Node. If set to false, it will return the newly added child.Parameters:
- array $formattingOptions An associative array which contains an options for formatting the code. The available options are:
- tab-spaces: The number of spaces in a tab. Usually 4.
- with-colors: A boolean value. If set to true, the code will be highlighted with colors.
- initial-tab: Number of initial tabs
- colors: An associative array of highlight colors.
- bg-color: The 'pre' block background color.
- attribute-color: HTML attribute name color.
- attribute-value-color: HTML attribute value color.
- text-color: Normal text color.
- comment-color: Comment color.
- operator-color: Assignment operator color.
- lt-gt-color: Less than and greater than color.
- node-name-color: Node name color.
Parameters:
- string $id The ID of the child.
Parameters:
Parameters:
- string $val The value of the tag (such as 'div' or 'input').
Parameters:
Parameters:
- string $path The location where the content will be written to (e.g. 'C:\user\html\pages'). must be non empty string.
- string $fileName The name of the file (such as 'index'). Must be non empty string.
- boolean $wellFormatted If set to true, The generated file will be well formatted (readable by humans).
Parameters:
- HeadNode $node The node to set.
Parameters:
Parameters:
- boolean $formatted If set to true, The generated HTML code will be well formatted. Default is true. Note that this attribute will take effect only if the formatting option is not set using the method HTMLNode::setIsFormatted().