Download the PHP package dneustadt/html-tag-replace without Composer
On this page you can find all versions of the php package dneustadt/html-tag-replace. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download dneustadt/html-tag-replace
More information about dneustadt/html-tag-replace
Files in dneustadt/html-tag-replace
Download dneustadt/html-tag-replace
More information about dneustadt/html-tag-replace
Files in dneustadt/html-tag-replace
Vendor dneustadt
Package html-tag-replace
Short Description Replace and enhance markup tags and/or attributes
License MIT
Homepage https://davidneustadt.de
Package html-tag-replace
Short Description Replace and enhance markup tags and/or attributes
License MIT
Homepage https://davidneustadt.de
Please rate this library. Is it a good library?
Informations about the package html-tag-replace
HtmlTagReplace
a helper to replace and enhance html tags and their attributes.
Features
- Append, prepend and switch tags.
- Add custom attributes to tags
- Switch, clone or remove attributes.
Usage
Create an Instance of HtmlTagReplace
passing existing markup.
Use replaceTag
method of said instance passing the following arguments:
search
Name of the tag to be replacedreplace
Name of the new tagclosingTag
(bool, default: false) defines whether searched tag has closing tagargumentsReplace
(array) key-value pairs (search => replace
) of attributes to be replaced. Multidimensional (search => array
) to clone value into multiple arguments.arguments
custom arguments injectedappend
injected after targeted tagprepend
injected before targeted tag
You can call the method compress
to minify the markup.
Finally retrieve the altered markup calling getMarkup
Example
will result in (not minified for readability):
Todos
- add more filter options for targeting tags
- optimize method for filtering and replacing arguments
- content manipulation
- synchronized replacement
All versions of html-tag-replace with dependencies
PHP Build Version
Package Version
No informations.
The package dneustadt/html-tag-replace contains the following files
Loading the files please wait ....