{"id":20346170,"url":"https://github.com/talesoft/tale-dom","last_synced_at":"2025-10-07T01:44:51.884Z","repository":{"id":57064778,"uuid":"52208082","full_name":"Talesoft/tale-dom","owner":"Talesoft","description":null,"archived":false,"fork":false,"pushed_at":"2016-05-20T22:10:16.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-17T05:05:28.624Z","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/Talesoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-21T13:35:12.000Z","updated_at":"2016-02-24T22:52:05.000Z","dependencies_parsed_at":"2022-08-24T07:50:25.286Z","dependency_job_id":null,"html_url":"https://github.com/Talesoft/tale-dom","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Talesoft/tale-dom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talesoft%2Ftale-dom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talesoft%2Ftale-dom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talesoft%2Ftale-dom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talesoft%2Ftale-dom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Talesoft","download_url":"https://codeload.github.com/Talesoft/tale-dom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talesoft%2Ftale-dom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278708043,"owners_count":26031932,"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-10-06T02:00:05.630Z","response_time":65,"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-14T22:11:48.074Z","updated_at":"2025-10-07T01:44:51.841Z","avatar_url":"https://github.com/Talesoft.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Tale Dom\n**A Tale Framework Component**\n\n# What is Tale Dom?\n\n\n\n# Installation\n\nInstall via Composer\n\n```bash\ncomposer require \"talesoft/tale-dom:*\"\ncomposer install\n```\n\n# Usage\n\n## Parsing\n```php\n\nuse Tale\\Dom;\n\n$element = Dom::fromString('\u003ch1\u003eHello World!\u003c/h1\u003e');\n\nvar_dump($element-\u003egetName()); //h1\nvar_dump($element-\u003egetText()); //Hello World!\n\n```\n\n\n# Manipulation\n```php\n\nuse Tale\\Dom;\n\n$m = Dom::manipulate('\u003cconfig /\u003e');\n\n$m-\u003eappend('db')\n    -\u003eappend('host')-\u003esetText('localhost')\n    -\u003eafter('password')-\u003esetText('12345')\n    -\u003eparent\n  -\u003eafter('logging')\n    -\u003eappend('adapter')-\u003esetText('file')\n    -\u003eappend('path')-\u003esetText('./errors.log')\n    \necho $m; //\u003cconfig\u003e\u003cdb\u003e\u003chost\u003elocalhost\u003c/host\u003e\u003cpassword\u003e12345\u003c/password\u003e...\u003c/config\u003e\n\n```\n\n...or shorter...\n```php\n\nuse Tale\\Dom;\n\n$m = Dom::manipulate('\n\u003cconfig\u003e\n    \u003cdb\u003e\n        \u003chost /\u003e\n        \u003cpassword /\u003e\n    \u003c/db\u003e\n    \u003clogging\u003e\n        \u003cadapter /\u003e\n        \u003cpath id=\"logPath\" /\u003e\n    \u003c/logging\u003e\n\u003c/config\u003e');\n\n$m-\u003equery('host')-\u003esetText('localhost');\n$m-\u003equery('db \u003e password')-\u003esetText('12345');\n$m-\u003equery('logging adapter')-\u003esetText('file');\n$m-\u003equery('#logPath')-\u003esetText('./errors.log');\n    \necho $m; //\u003cconfig\u003e\u003cdb\u003e\u003chost\u003elocalhost\u003c/host\u003e\u003cpassword\u003e12345\u003c/password\u003e...\u003c/config\u003e\n\n```\n\n...or even shorter...\n```php\n\nuse Tale\\Dom;\n\n$m = Dom::manipulate([\n    'config' =\u003e [\n        'host' =\u003e 'localhost',\n        'password' =\u003e '12345'\n    ],\n    'logging' =\u003e [\n        'adapter' =\u003e 'file',\n        'path#logPath'\n    ]\n]);\n\n$m-\u003equery('#logPath')-\u003esetText('./errors.log');\n    \necho $m; //\u003cconfig\u003e\u003cdb\u003e\u003chost\u003elocalhost\u003c/host\u003e\u003cpassword\u003e12345\u003c/password\u003e...\u003c/config\u003e\n\n```\n\n\n## Dumping\n```php\n\nuse Tale\\Dom;\n\n$element = Dom::fromString([\n    'html' =\u003e [\n        'head' =\u003e [\n            'meta[charset=\"utf-8\"]',\n            'title' =\u003e 'My awesome Tale Dom Website!'\n        ]\n    ]\n]);\n\n$prettyFormatter = new Dom\\Formatter(['pretty' =\u003e true]);\n$htmlFormatter = new Dom\\Html\\Formatter(['pretty' =\u003e true]);\n\necho $element; //\u003chtml\u003e\u003chead\u003e\u003cmeta charset=\"utf-8\" /\u003e\u003ctitle\u003e...\u003c/html\u003e\n\necho $element-\u003egetString($prettyFormatter);\n/*\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\" /\u003e\n    \u003ctitle\u003eMy awesome Tale Dom Website!\u003c/title\u003e\n    ...\n\u003c/html\u003e\n*/\n\n\necho $element-\u003egetString($htmlFormatter);\n/*\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003ctitle\u003eMy awesome Tale Dom Website!\u003c/title\u003e\n    ...\n\u003c/html\u003e\n*/\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalesoft%2Ftale-dom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalesoft%2Ftale-dom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalesoft%2Ftale-dom/lists"}