{"id":18427114,"url":"https://github.com/nowisesys/uup-html","last_synced_at":"2025-04-13T19:38:40.625Z","repository":{"id":57028833,"uuid":"167267572","full_name":"nowisesys/uup-html","owner":"nowisesys","description":"Object oriented HTML class library","archived":false,"fork":false,"pushed_at":"2019-10-15T02:59:35.000Z","size":93,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-16T08:27:30.241Z","etag":null,"topics":["html","php-library","render"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nowisesys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-23T23:02:54.000Z","updated_at":"2019-10-15T02:59:37.000Z","dependencies_parsed_at":"2022-08-23T16:30:16.930Z","dependency_job_id":null,"html_url":"https://github.com/nowisesys/uup-html","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowisesys%2Fuup-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowisesys%2Fuup-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowisesys%2Fuup-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowisesys%2Fuup-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nowisesys","download_url":"https://codeload.github.com/nowisesys/uup-html/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248769379,"owners_count":21158808,"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":["html","php-library","render"],"created_at":"2024-11-06T05:09:41.176Z","updated_at":"2025-04-13T19:38:40.600Z","avatar_url":"https://github.com/nowisesys.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## UUP-HTML - Object oriented HTML class library for PHP\n\nAn object oriented PHP library for generating HTML. It consists of component, \ncontainer and utility classes making it possible to e.g. compose a form or table \nwithout having to bother with HTM tags.\n\n### Usage\n\nThe usage pattern is to create an container object (like a form) and add child \ncontainers and components to it. Once composed, just call output() to make it \ngenerate the HTML code.\n\nThe add methods create and return a object. This makes it easy to incremental \nadding child objects and setting properties on them. Heres an simple example on \nthis concept for a form:\n\n```php\n$options = array('opt1' =\u003e 'val1', 'opt2' =\u003e 'val2');\n\n$form = new Form('script.php');\n\n$combo = $form-\u003eaddComboBox('opt');                     // Got ComboBox object in return\nforeach ($options as $name =\u003e $value) {\n        $option = $combo-\u003eaddOption($value, $name);     // Get Option object in return\n}\n\n$form-\u003eaddSubmitButton();\n$form-\u003eoutput();                                        // Output this form\n```\n\nAll objects can be added to another container. The output is started when calling \noutput() on the top container. We could do like this:\n\n```php\n$paragraph = new Paragraph();\n$paragraph-\u003eaddElement($form);         // Add form to paragraph\n$paragraph-\u003eoutput();                  // Calls output on form object implicit\n```\n\nJavascript events can be attached to all objects by appending a code fragment for wanted event:\n\n```php\n$textbox = new TextBox('username');\n$textbox-\u003esetEvent(Event::ON_BLUR, 'if(this.value === \"\") { '\n    . 'alert(\"Username can\\'t be empty\"); '\n    . 'this.focus(); '\n    . '}');\n```\n\nA couple of prepared event handler is defined in the Event class:\n\n```php\n$textbox = new TextBox('username');\n$textbox-\u003esetEvent(Event::ON_DOUBLE_CLICK, EVENT_HANDLER_CLEAR_CONTENT);\n```\n\n### More\n\nVisit the [project page](https://nowise.se/oss/uup/html) for more information.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowisesys%2Fuup-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnowisesys%2Fuup-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowisesys%2Fuup-html/lists"}