Welcome to ezHTMLAS Documentation
Thank you for visiting the ezHTMLAS documentation! Here you will find detailed information and instructions to help you get started with ezHTMLAS, a powerful HTML parsing and manipulation library. Whether you are a beginner or an experienced developer, this documentation will provide you with the necessary guidance to make the most out of ezHTMLAS.
Getting Started
If you are new to ezHTMLAS, this section will guide you through the basics and show you how to install and set up the library.
Requirements
- PHP 7.0 or higher
Installation
To install ezHTMLAS, follow these simple steps:
- Navigate to your project’s root directory
- Open the terminal
- Run the following composer command:
composer require vendor/ezhtmlas
Once the installation process is complete, you can start using ezHTMLAS in your project.
Usage
This section will walk you through some commonly used features and functionalities of ezHTMLAS.
Parsing HTML
To parse an HTML document, use the following code:
$html = <html>
<body>
<h1>Hello, ezHTMLAS!</h1>
</body>
</html>;
$parsedHtml = ezHTMLAS::parse($html); // Returns a parsed HTML object
The parse()
method parses the provided HTML string and returns an instance of the parsed HTML object $parsedHtml
.
Manipulating HTML
ezHTMLAS provides various methods to manipulate the parsed HTML object. Here are a few examples:
$parsedHtml->getElementsByTagName('h1')[0]->setAttributes(['class' => 'title']);
$parsedHtml->getElementById('myDiv')->removeAttribute('style');
$parsedHtml->getElementById('myDiv')->addClass('highlight');
The example code showcases how to set attributes, remove attributes, and add classes to specific HTML elements using ezHTMLAS methods.
Generating HTML
Once you have made the necessary changes to the parsed HTML object, you can generate the modified HTML string using the following code:
$modifiedHtml = $parsedHtml->toHtml(); // Returns the modified HTML string
The toHtml()
method generates the modified HTML string based on the updated parsed HTML object.
Advanced Features
In this section, you will find information about advanced features of ezHTMLAS such as scraping data, extracting specific elements, and more. Stay tuned for upcoming updates to the documentation.
Examples and Tutorials
We understand that practical examples and tutorials are invaluable when learning a new library. In this section, you will find a collection of useful examples and tutorials to help you master ezHTMLAS.
Support and Community
If you have any questions, run into issues, or want to join the ezHTMLAS community, we’re here to help. Check out the resources below:
- GitHub Repository: https://github.com/ezhtmlas
- Support Forum: https://forum.ezhtmlas.com
- Documentation Feedback: documentation@ezhtmlas.com
Contributing
We welcome contributions to the ezHTMLAS library. If you’re interested in contributing, please refer to our contributing guidelines for more information on how to get started.
Version History
This section provides an overview of the version history and changelog for ezHTMLAS, allowing you to stay up-to-date with the latest features and bug fixes.
License
ezHTMLAS is released under the MIT License. Please review the license file for more information.