{"id":18929556,"url":"https://github.com/thecodingmachine/html.html_element","last_synced_at":"2026-02-06T03:31:05.809Z","repository":{"id":4358838,"uuid":"5495105","full_name":"thecodingmachine/html.html_element","owner":"thecodingmachine","description":"This package contains the HtmlElementInterface interface that can be used to output HTML on a page. It also features base classes implementing this interface.","archived":false,"fork":false,"pushed_at":"2018-08-22T21:08:29.000Z","size":19,"stargazers_count":2,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"2.0","last_synced_at":"2025-10-20T06:24:47.019Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodingmachine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-21T13:04:25.000Z","updated_at":"2023-11-11T00:29:22.000Z","dependencies_parsed_at":"2022-08-22T20:31:20.804Z","dependency_job_id":null,"html_url":"https://github.com/thecodingmachine/html.html_element","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/thecodingmachine/html.html_element","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fhtml.html_element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fhtml.html_element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fhtml.html_element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fhtml.html_element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodingmachine","download_url":"https://codeload.github.com/thecodingmachine/html.html_element/tar.gz/refs/heads/2.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fhtml.html_element/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29148097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T02:39:25.012Z","status":"ssl_error","status_checked_at":"2026-02-06T02:37:22.784Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-08T11:33:34.915Z","updated_at":"2026-02-06T03:31:05.790Z","avatar_url":"https://github.com/thecodingmachine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"What is this package?\n=====================\n\nThis package contains an interface used to render objects in HTML.\nBasically, instances of classes implementing this interface provide a toHtml method that can be used to get some HTML.\n\nThe concept is very abstract, but also very powerful. Let's take a sample:\n\n- you might write a \"HtmlButtonElement\" class that would render a simple HTML button.\n- you might write a \"HtmlCalendarElement\" class that would render a calendar.\n- you might write a \"HtmlTemplateElement\" class that would render a full template.\n- ...\n\nObviously, this package is useless on its own. It is useful only if you implement the interface in your classes.\n\nIn practice\n-----------\n\nImplementing the HtmlElementInterface is simple stupid: just add a \"toHtml\" method to your code:\n\n\t/**\n\t * Renders the object in HTML.\n\t * The Html is echoed directly into the output.\n\t */\n\tfunction toHtml();\n\nProvided classes\n----------------\n\nThis package comes with a few classes implementing the HtmlElementInterface:\n\n- **HtmlString**: this class contains a string that is outputed when you call the toHtml method\n- **HtmlFromFile**: this class refers to a PHP file that is required when you call the toHtml method  \n- **HtmlFromFunction**: this class refers to a PHP callable (method, function, ...) that is called when you call the toHtml method\n\n\nMouf package\n------------\n\nThis package is part of [Mouf](http://mouf-php.com), an effort to ensure good developing practices by providing a graphical dependency injection framework.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fhtml.html_element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodingmachine%2Fhtml.html_element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fhtml.html_element/lists"}