* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$tag` | **string** | The tag name. | | `$params` | **array** | The optional parameters for the tag. | | `$html` | **array** | The optional HTML content within the tag. | | `$glue` | **string|null** | The optional string used to join multiple HTML elements. If not provided, the default value is used. | **Return Value:** The HTML representation of the tag, including parameters and content. *** ### getTag Retrieves a formatted string representing a specific tag with the given parameters and HTML attributes.
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$tag` | **string** | The name of the tag to retrieve. | | `$params` | **array** | An optional array of parameters to pass as attributes to the tag. | | `$html` | **array** | An optional array of HTML attributes to include in the tag. | | `$glue` | **string|null** | An optional glue string for joining the HTML attributes. | **Return Value:** The formatted HTML string representing the tag with the provided parameters and attributes. *** ### tag Prints the HTML code for a given tag, with optional parameters and HTML attributes.
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$tag` | **string** | The HTML tag to be printed. | | `$params` | **array** | The parameters to be included in the HTML tag attributes. | | `$html` | **array** | The HTML attributes to be included in the HTML tag. | | `$glue` | **?string** | The optional string used to concatenate the HTML attributes. | *** ### getTagParams Retrieves the tag parameters based on the given tag name, additional parameters, format string, and glue string.
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$tag` | **string** | The name of the tag to retrieve the parameters for. | | `$params` | **array** | (Optional) Additional parameters to merge with the tag attributes. The parameters should be provided as an associative array with keys representing the parameter names. | | `$format` | **string** | (Optional) The format string to use when formatting the tag parameters. The format string should contain two placeholders: %1$s for the parameter value and % 2$s for the parameter name. | | `$glue` | **string|null** | (Optional) The glue string to use when joining the formatted tag parameters. If null, the default glue string will be used. | **Return Value:** The formatted tag parameters joined by the glue string. *** ### tagParams Returns a formatted string containing tag parameters for the specified tag.
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$tag` | **string** | The tag to be used. | | `$params` | **array** | The parameters to be added to the tag. The parameters should be provided as an associative array with keys representing the parameter names and values representing the parameter values. | | `$format` | **string** | The format string used to concatenate each parameter. The format string should contain two placeholders ('%1$s' and '%2$s') that will be replaced with the parameter value and name, respectively. The default format is ' %2$s="%1$s"'. | | `$glue` | **string|null** | The glue used to concatenate multiple parameters. If null, the default PHP glue will be used. | *** ### getParams Will sprintf an array_map of the array and then implode it with a ' ' glue - Escape attrs and values during the process
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$params` | **array** | An array containing the parameters to be formatted. The parameters should be provided as an associative array with keys representing the parameter names and values representing the parameter values. | | `$format` | **string** | The format string used to format each parameter. The format string should contain two placeholders: %1$s representing the parameter value and %2$s representing the parameter name. | | `$glue` | **null|string** | (optional) The string used to glue multiple formatted parameters together. If not provided, the default glue value will be used. | *** ### getAttr Retrieves the attributes of a specific name from the existing list of attributes.
publicstaticgetAttr(string$name):array
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$name` | **string** | The name of the attribute to retrieve. | **Return Value:** An array containing the attributes corresponding to the given name. If the attribute does not exist, an empty array is returned. *** ### getAttrs Retrieves the existing list of attributes.
publicstaticgetAttrs():array
* This method is **static**. **Return Value:** Returns an array containing the existing list of attributes. The attributes are represented as key-value pairs. *** ### setAttr Sets attributes for a given name.
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$name` | **string** | The name of the attribute. | | `$attrs` | **array** | The attributes to be set for the given name. The attributes should be an associative array with keys representing the attribute names. | | `$merge` | **bool** | Optional. Specifies whether to merge the new attributes with existing attributes. Default is true. | *** ### setAttrs Sets attributes for the object.
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$attrs` | **array** | An array of attributes to be set. Each attribute key represents the name of the attribute and the value represents the value of the attribute. | | `$merge` | **bool** | Optional. Determines whether the existing attributes should be merged with the new attributes. Defaults to false. | **Return Value:** The updated attributes array after setting the new attributes. *** ### resetAttrs Reset attributes
publicstaticresetAttrs():void
* This method is **static**. *** ### setMetaCharset Set the meta charset value Specifies the character encoding for the HTML document.
Use example: Tag::setMetaCharset('UTF-8'); Tag::meta('charset', 'UTF-8'); Common values: UTF-8 - Character encoding for Unicode ISO-8859-1 - Character encoding for the Latin alphabet In theory, any character encoding can be used, but no browser understands all of them. The more widely a character encoding is used, the better the chance that a browser will understand it. To view all available character encodings, look at IANA character sets. http://www.iana.org/assignments/character-sets/character-sets.xhtml For more information about the charset values, please visit this documentation below https://www.w3schools.com/tags/att_meta_charset.asp * This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$charset` | **string** | | *** ### setMetaProperty Sets the value of a meta property.
This method sets the specified meta property with the given content. If there is already a meta property with the same name, it will be removed before adding the new one. * This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$property` | **string** | The name of the meta property to set. | | `$content` | **string|null** | The content to set for the meta property. It can be null if the property doesn't require content. | *** ### setMetaName Set the meta name attribute with the given value.
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$name` | **string** | The name of the meta tag. | | `$content` | **string|null** | The content of the meta tag. Optional, defaults to null. | *** ### addMeta Add meta
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$attr` | **string** | The attribute of the meta tag | | `$value` | **string** | The value of the attribute | | `$content` | **string|null** | (optional) The content of the meta tag | *** ### addRawMeta Add raw meta
publicstaticaddRawMeta(array$meta):void
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$meta` | **array** | The meta data to be added | *** ### addLink Add a new link tag
Use example: Tag::addLink('rel', 'alternate', ['type' => 'application/atom+xml', 'title' => 'Zemit CMS', 'href' => '/blog/news/atom"']); For more information about the attr, values and other options please visite the w3schools documentation below https://www.w3schools.com/tags/tag_link.asp * This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$attr` | **string** | Link tag attr | | `$value` | **string** | Link tag attr value | | `$options` | **array** | Link tag attrs and values | *** ### addRawLink Adds a raw link to the existing list of links.
publicstaticaddRawLink(array$link):void
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$link` | **array** | The raw link to be added. The link should be an associative array with keys representing the link attributes. | *** ### removeMeta Removes meta tags from the existing list of meta tags based on the specified attribute, value, and content.
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$attr` | **string** | The attribute of the meta tags to be removed. | | `$value` | **string|null** | The value of the attribute. If null, all meta tags with the specified attribute will be removed. | | `$content` | **string|null** | The content of the meta tags. If null, all meta tags with the specified attribute and value will be removed. | *** ### getMeta Retrieves the concatenated string representation of the meta values.
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$glue` | **string|null** | The optional glue string used to concatenate the meta values. Default is null. | **Return Value:** The concatenated string representation of the meta values, or null if there are no meta values. *** ### meta Prints the meta information using the specified glue.
publicstaticmeta(string|null$glue=null):void
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$glue` | **string|null** | The glue to be used for concatenating the meta information. If not provided, the default value is null. | *** ### getLink Retrieves the links as a concatenated string with an optional glue separator.
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$glue` | **string|null** | The separator used to concatenate the links. If null, no separator is used. Default value is null. | **Return Value:** The concatenated string of links, or null if there are no links. *** ### link Generates and echoes the link string.
publicstaticlink(string|null$glue=null):void
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$glue` | **string|null** | The glue used to join the link attributes (optional). Default value is null. | *** ### getCss Retrieves the CSS markup for the specified collection or all collections if no collection is specified.
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$collection` | **string|null** | (optional) The name of the collection. If not specified, all collections will be included. | **Return Value:** The CSS markup for the specified collection or all collections. Returns null if no CSS is found. *** ### css Prints the CSS markup for the specified collection or the default collection if no collection is provided.
publicstaticcss(string|null$collection=null):void
If a collection is provided, it should be a string representing the name of the CSS collection. If no collection is provided, the default collection will be used. * This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$collection` | **string|null** | The name of the CSS collection. Defaults to null. | *** ### getJs Retrieves JavaScript markup from the given asset collection or from all asset collections if none is specified.
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$collection` | **string|null** | Optional. The name of the asset collection. If not provided, JavaScript code from all asset collections will be retrieved. | **Return Value:** The generated JavaScript code, or null if no JavaScript code is found for the specified collection(s). *** ### js Outputs the JavaScript markup for a specific collection or for all collections if no collection is specified.
publicstaticjs(string|null$collection=null):void
* This method is **static**. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$collection` | **string|null** | The name of the collection to retrieve the JavaScript from. If null, all collections will be included. | *** ***