{"id":18794571,"url":"https://github.com/effectra/html-render","last_synced_at":"2025-08-02T06:09:06.688Z","repository":{"id":169881562,"uuid":"645948579","full_name":"effectra/html-render","owner":"effectra","description":"Effectra HTML Render is a PHP library that provides a set of classes for generating and manipulating HTML elements in an object-oriented manner.","archived":false,"fork":false,"pushed_at":"2023-06-18T20:13:17.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-21T16:13:02.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/effectra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-26T20:42:56.000Z","updated_at":"2023-05-26T20:48:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"2c717703-9fc0-45df-b515-a6bcb566ba53","html_url":"https://github.com/effectra/html-render","commit_stats":null,"previous_names":["effectra/html-render"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/effectra/html-render","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Fhtml-render","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Fhtml-render/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Fhtml-render/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Fhtml-render/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/effectra","download_url":"https://codeload.github.com/effectra/html-render/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Fhtml-render/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268340169,"owners_count":24234675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T21:29:48.691Z","updated_at":"2025-08-02T06:09:06.661Z","avatar_url":"https://github.com/effectra.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Effectra HTML Render\n\nEffectra HTML Render is a PHP library that provides a set of classes for generating and manipulating HTML elements in an object-oriented manner.\n\n## Installation\n\nYou can install the package via Composer. Run the following command in your terminal:\n\n```bash\ncomposer require effectra/html-render\n```\n\n## Usage\n\n### Creating HTML Elements\n\nThe `HtmlElement` class allows you to create HTML elements with different tags, content, and attributes. Here's an example of how to create an HTML element:\n\n```php\nuse Effectra\\HtmlRender\\HtmlElement;\n\n// Create an HTML element with a \u003cdiv\u003e tag and some content\n$element = new HtmlElement('This is a div element', 'div');\n\n// Get the content of the HTML element\n$content = $element-\u003egetContent();\necho $content; // Output: This is a div element\n\n// Get the tag name of the HTML element\n$tag = $element-\u003egetTag();\necho $tag; // Output: div\n\n// Get all attributes of the HTML element\n$attributes = $element-\u003egetAttributes();\nprint_r($attributes); // Output: []\n\n// Set the content of the HTML element and create a new instance\n$newElement = $element-\u003ewithContent('New content');\n```\n\n### Generating HTML Tags\n\nThe `Render` class provides static methods for generating common HTML tags. Here are some examples:\n\n```php\nuse Effectra\\HtmlRender\\Render;\n\n// Generate the HTML \u003chtml\u003e tag\n$htmlTag = Render::tagHtml('Content', 'en');\n\n// Generate the HTML \u003chead\u003e tag\n$headTag = Render::tagHead('Head content');\n\n// Generate the HTML \u003cbody\u003e tag\n$bodyTag = Render::tagBody('Body content');\n\n// Generate the HTML \u003ctitle\u003e tag\n$titleTag = Render::tagTitle('Page Title');\n```\n\n### Using the HTML Element Factory\n\nThe `HtmlElementFactory` class is a factory for creating instances of the `HtmlElement` class. Here's an example:\n\n```php\nuse Effectra\\HtmlRender\\Factory\\HtmlElementFactory;\n\n$factory = new HtmlElementFactory();\n\n// Create an HTML element using the factory\n$element = $factory-\u003ecreateHtmlElement('Element content', 'span', ['class' =\u003e 'highlight']);\n\n// Get the content of the created element\n$content = $element-\u003egetContent();\necho $content; // Output: Element content\n```\n\n## Contributing\n\nContributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.\n\n## License\n\nThis package is open-source and licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffectra%2Fhtml-render","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feffectra%2Fhtml-render","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffectra%2Fhtml-render/lists"}