{"id":26101610,"url":"https://github.com/vardumper/extended-htmldocument","last_synced_at":"2026-05-09T12:16:33.387Z","repository":{"id":277918719,"uuid":"933911647","full_name":"vardumper/extended-htmldocument","owner":"vardumper","description":"Semantic HTML5 elements as PHP classes. Includes a wrapper with convenience methods – built on top of PHP 8.4's DOM\\HTMLDocument ","archived":false,"fork":false,"pushed_at":"2025-03-31T07:10:17.000Z","size":20484,"stargazers_count":2,"open_issues_count":10,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T07:31:19.587Z","etag":null,"topics":["design-system","html","html5","php"],"latest_commit_sha":null,"homepage":"https://vardumper.github.io/extended-htmldocument/","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/vardumper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["vardumper"],"buy_me_a_coffee":"vardumper","custom":["https://paypal.me/vardumper"]}},"created_at":"2025-02-17T00:24:26.000Z","updated_at":"2025-03-22T20:19:38.000Z","dependencies_parsed_at":"2025-03-23T15:23:10.977Z","dependency_job_id":null,"html_url":"https://github.com/vardumper/extended-htmldocument","commit_stats":null,"previous_names":["vardumper/usefulhtmldocument","vardumper/extendedhtmldocument","vardumper/extended-htmldocument"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardumper%2Fextended-htmldocument","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardumper%2Fextended-htmldocument/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardumper%2Fextended-htmldocument/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardumper%2Fextended-htmldocument/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vardumper","download_url":"https://codeload.github.com/vardumper/extended-htmldocument/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248591982,"owners_count":21130160,"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","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":["design-system","html","html5","php"],"created_at":"2025-03-09T18:50:10.652Z","updated_at":"2026-04-12T10:09:57.006Z","avatar_url":"https://github.com/vardumper.png","language":"PHP","funding_links":["https://github.com/sponsors/vardumper","https://buymeacoffee.com/vardumper","https://paypal.me/vardumper"],"categories":[],"sub_categories":[],"readme":"\u003ctable align=\"center\" style=\"border-collapse:collapse !important; border:none !important;\"\u003e\n  \u003ctr style=\"border:0px none; border-top: 0px none !important;\"\u003e\n    \u003ctd align=\"center\" valign=\"middle\" style=\"padding:0 1rem; border:none !important;\"\u003e\n      \u003ca href=\"https://www.w3.org/TR/2011/WD-html5-20110405/\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://vardumper.github.io/extended-htmldocument/html5_logo-with-wordmark.svg\" style=\"display:block; height:90px; width:auto; max-width:300px;\" alt=\"HTML5 Logo\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" valign=\"middle\" style=\"padding:0 1rem; border:none !important;\"\u003e\n      \u003ca href=\"https://www.php.net/manual/de/class.dom-htmldocument.php\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://vardumper.github.io/extended-htmldocument/file_type_php3.svg\" style=\"display:block; height:100px; width:auto; max-width:220px;\" alt=\"PHP Logo\" /\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\u003ch1 align=\"center\"\u003eExtended HTML Document Library\u003c/h1\u003e\n\n\u003cp dir=\"auto\" align=\"center\"\u003e\n  \u003ca href=\"https://dtrack.erikpoehler.us/projects/37279553-0c47-476a-9efd-ed379fabca1a\" rel=\"nofollow\"\u003e\n    \u003cimg src=\"https://dtrack.erikpoehler.us/api/v1/badge/vulns/project/37279553-0c47-476a-9efd-ed379fabca1a?apiKey=odt_nG83W_EAcQZkk6b5KqknIVoK8nfNjSz38Ompnn\"\u003e \n  \u003c/a\u003e\n\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/0395833017ab75581633c6828b2a15a3e2b8146edfd2fc916b8c4dab59859441/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f756e697425323074657374732d70617373696e672d677265656e3f7374796c653d666c617426636f6c6f723d253233346331\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/0395833017ab75581633c6828b2a15a3e2b8146edfd2fc916b8c4dab59859441/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f756e697425323074657374732d70617373696e672d677265656e3f7374796c653d666c617426636f6c6f723d253233346331\" alt=\"Static Badge\" data-canonical-src=\"https://img.shields.io/badge/unit%20tests-passing-green?style=flat\u0026amp;color=%234c1\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://vardumper.github.io/extended-htmldocument/unit-tests\" rel=\"nofollow\"\u003e\u003cimg src=\"https://github.com/vardumper/extended-htmldocument/raw/main/coverage.svg\" alt=\"Code Coverage\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/vardumper/extended-htmldocument\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/f0ea27fa2c20e81d786e2317d886a9ce6abf5948f3e666d34ff35d4d7f26efce/68747470733a2f2f706f7365722e707567782e6f72672f76617264756d7065722f657874656e6465642d68746d6c646f63756d656e742f762f737461626c65\" alt=\"Latest Stable Version\" data-canonical-src=\"https://poser.pugx.org/vardumper/extended-htmldocument/v/stable\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/vardumper/extended-htmldocument\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/d94dac4925a74bfbe6577d497be10251d245540ff43c18d7c9a4ac368ec074a6/68747470733a2f2f706f7365722e707567782e6f72672f76617264756d7065722f657874656e6465642d68746d6c646f63756d656e742f646f776e6c6f616473\" alt=\"Total Downloads\" data-canonical-src=\"https://poser.pugx.org/vardumper/extended-htmldocument/downloads\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\nThis library provides a way to work with HTML elements in PHP, offering an object-oriented approach that aligns with the HTML5 specifications.\nIt also provides a way to automatically transform HTML into different templating engines or code for frontend frameworks.\nIt also adds autocompletion to PHP for all HTML5 elements, which is especially useful when working with DOM Documents.\nIt adds additional functionality and a stronger focus on HTML5 while being fully compatible with PHP's DOM\\HTMLDocument and DOM\\HTMLElement classes.\n\n## Installation\n```bash\ncomposer require --dev vardumper/extended-htmldocument\n```\n\n## TL;DR\n\nThis library adds the HTML5 specification to PHP and is fully compatible with `DOM\\HTMLDocument`. You can now instantiate an `Anchor` without passing a document.\n\n```php\nuse Html\\Element\\Inline\\Anchor;\nuse Html\\Enum\\RelEnum;\n\necho (new Anchor())\n    -\u003esetClass('secondary')\n    -\u003esetRel(RelEnum::NOFOLLOW)\n    -\u003esetHref('https://google.com')\n    -\u003esetTitle('Google it')\n    -\u003esetContent('Click me');\n// produces: \u003ca class=\"secondary\" href=\"https://google.com\" rel=\"nofollow\" title=\"Google it\"\u003eClick me\u003c/a\u003e\n```\n## Generated Templates\nTemplates are generated from the HTML5 schema for every HTML element. These allow for better consistency in your design system(s), support all possible HTML attributes and have basic validations for enum attributes.\nFiles are grouped into inline, block and void elements. For elements with a specific content model, a composed template is generated as well. (eg `\u003ctable\u003e\u003ctr\u003e\u003ctd\u003eCell\u003c/td\u003e\u003ctr\u003e\u003c/table\u003e`)\n\n### Blade\nBlade templates can be found in [`templates/blade`](https://github.com/vardumper/extended-htmldocument/tree/main/templates/blade). The [README](https://github.com/vardumper/extended-htmldocument/blob/main/templates/blade/README.md) has more infos and usage examples. Blade templates can also be installed via `npm` with the [@typesafe-html5/blade](https://www.npmjs.com/package/@typesafe-html5/blade) package.\n### React \u0026 NextJS\nReact and NextJS templates can be found in `templates/blade`. See the Blade-specific [README](https://github.com/vardumper/extended-htmldocument/blob/main/templates/blade/README.md) file for details. Blade templates can also be installed via `npm` with the [@typesafe-html5/react](https://www.npmjs.com/package/@typesafe-html5/react) package.\n### Storybook \nStorybook with atoms for all HTML5 elements can be [seen in the Demo](https://vardumper.github.io/extended-htmldocument/storybook-site/). Files can be found in [`templates/storybook`](https://github.com/vardumper/extended-htmldocument/tree/main/templates/storybook). There's also a [README](https://github.com/vardumper/extended-htmldocument/blob/main/templates/storybook/README.md) with more details.\n### Storybook for Twig\nTBD\n### Storybook for React/NextJS\nTBD\n### Twig\nTwig templates for flexible and performant use with `include`, `embed`, and `use` can be found in [`templates/twig`](https://github.com/vardumper/extended-htmldocument/tree/main/templates/twig). See the [README](https://github.com/vardumper/extended-htmldocument/blob/main/templates/twig/README.md) for more details and usage examples. Twig templates can also be installed via `npm` with the [@typesafe-html5/twig](https://www.npmjs.com/package/@typesafe-html5/twig) package.\n### Twig Components Bundle\nGenerated, typesafe Twig Components for use with Symfony UXs Twig Components can be found in [`templates/twig-component`](https://github.com/vardumper/extended-htmldocument/tree/main/templates/twig-component). See the [README](https://github.com/vardumper/extended-htmldocument/blob/main/templates/twig-component/README.md) for more details and usage examples. Twig templates can also be installed via the Symfony Bundle [vardumper/html5-twig-component-bundle](https://github.com/vardumper/html5-twig-component-bundle) package.\n### Typescript\nTypescript templates can be found in [`templates/typescript`](https://github.com/vardumper/extended-htmldocument/tree/main/templates/typescript). See the [README](https://github.com/vardumper/extended-htmldocument/blob/main/templates/typescript/README.md) for more details and usage examples. Typescript templates can also be installed via `npm` with the [@typesafe-html5/typescript](https://www.npmjs.com/package/@typesafe-html5/typescript) package.\n\n## Documentation\nSee the [Documentation](https://vardumper.github.io/extended-htmldocument/) for more.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvardumper%2Fextended-htmldocument","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvardumper%2Fextended-htmldocument","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvardumper%2Fextended-htmldocument/lists"}