{"id":21989189,"url":"https://github.com/repcomm/component-php","last_synced_at":"2025-03-23T02:45:17.672Z","repository":{"id":130853852,"uuid":"317106212","full_name":"RepComm/component-php","owner":"RepComm","description":"exponent-ts pseudo-ported to PHP so I don't have to write screwy PHP code","archived":false,"fork":false,"pushed_at":"2020-11-30T18:59:48.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-28T08:51:41.308Z","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/RepComm.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":"2020-11-30T04:00:23.000Z","updated_at":"2020-11-30T18:59:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b9d3315-c783-4475-8da0-3008251a8cb5","html_url":"https://github.com/RepComm/component-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RepComm%2Fcomponent-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RepComm%2Fcomponent-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RepComm%2Fcomponent-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RepComm%2Fcomponent-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RepComm","download_url":"https://codeload.github.com/RepComm/component-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245048275,"owners_count":20552483,"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":[],"created_at":"2024-11-29T19:28:19.382Z","updated_at":"2025-03-23T02:45:17.645Z","avatar_url":"https://github.com/RepComm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# component\nA pseudo-port of [exponent-ts](https://github.com/RepComm/exponent-ts) for PHP\n\nExample usage\n```php\n\n//include the lib\ninclude_once(\"component.php\");\n\nfunction test_component_php () {\n  //Create a container for our content\n  $content = new Component();\n\n  $content-\u003emake(\"div\")-\u003e\n  textContent(\"Hello World\")-\u003e\n\n  //Styling\n  styleItem(\"position\", \"absolute\")-\u003e\n  styleItem(\"top\", \"25%\")-\u003e\n  styleItem(\"left\", \"25%\")-\u003e\n  styleItem(\"width\", \"50vw\")-\u003e\n  styleItem(\"height\", \"50vh\")-\u003e\n  styleItem(\"background-color\", \"black\")-\u003e\n  styleItem(\"color\", \"white\");\n\n  //Iterate from 0 to 9\n\n  //Declaring variable outside of the loop should save us some performance\n  $child = 0;\n\n  for ($i=0; $i \u003c 10; $i++) {\n    //Create a line break\n    $child = new Component();\n    $child-\u003emake(\"br\")-\u003e\n\n    //attach to the content as a child\n    mount($content);\n\n    //Create text span\n    $child = new Component();\n    $child-\u003emake(\"span\")-\u003e\n\n    //set the text content to \"span \" + iteration number\n    textContent(\"span \" . sprintf(\"%d\", $i) )-\u003e\n\n    //attach to the content as a child\n    mount($content);\n  }\n\n  //walk the hierarchy and echo the HTML generated\n  writeComponent($content);\n}\n\ntest_component_php();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frepcomm%2Fcomponent-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frepcomm%2Fcomponent-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frepcomm%2Fcomponent-php/lists"}