Download the PHP package ui-awesome/html-svg without Composer
On this page you can find all versions of the php package ui-awesome/html-svg. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ui-awesome/html-svg
More information about ui-awesome/html-svg
Files in ui-awesome/html-svg
Informations about the package html-svg
UI Awesome HTML SVG Tag for PHP.
The svg element is a container that defines a new coordinate system and viewport.
It is used as the outermost element of SVG documents, but it can also be used to embed an SVG fragment inside an SVG or HTML document.
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Usage
Instantiate the Svg
class using Svg::widget()
.
Setting Attributes
Use the provided methods to set specific attributes for the a element.
Or, use the attributes
method to set multiple attributes at once.
Adding Content
If you want to include content within the svg
tag, use the content
method.
Rendering
Generate the HTML
output using the render
method, for simple instantiation.
Or, use the magic __toString
method.
Common Use Cases
Below are examples of common use cases:
Explore additional methods for setting various attributes such as fill
, heigth
, lang
, name
, style
, title
,
viewbox
, width
, xmlns
, etc.
Attributes
Refer to the Attribute Tests for comprehensive examples.
The following methods are available for setting attributes:
Method | Description |
---|---|
attributes() |
Set multiple attributes at once. |
class() |
Set the class attribute. |
content() |
Set the content within the svg element. |
fill() |
Set the fill attribute. |
height() |
Set the height attribute. |
id() |
Set the id attribute. |
lang() |
Set the lang attribute. |
name() |
Set the name attribute. |
stroke() |
Set the stroke attribute. |
style() |
Set the style attribute. |
title() |
Set the title attribute. |
viewBox() |
Set the viewBox attribute. |
width() |
Set the width attribute. |
xmlns() |
Set the xmlns attribute. |
Custom methods
Refer to the Custom Methods Tests for comprehensive examples.
The following methods are available for customizing the HTML
output:
Method | Description |
---|---|
filePath() |
Set the file path for the HTML output. |
render() |
Generates the HTML output. |
widget() |
Instantiates the Svg::class . |
Testing
Check the documentation testing to learn about testing.
Support versions
License
The MIT License (MIT). Please see License File for more information.
Our social networks
All versions of html-svg with dependencies
ext-dom Version *
ext-libxml Version *
enshrined/svg-sanitize Version ^0.18
php-forge/awesome-widget Version ^0.1
ui-awesome/html-attribute Version ^0.2
ui-awesome/html-concern Version ^0.2
ui-awesome/html-core Version ^0.1
ui-awesome/html-interop Version ^0.1