{"id":29079585,"url":"https://github.com/markusfisch/phapp","last_synced_at":"2025-10-28T23:14:16.187Z","repository":{"id":7337444,"uuid":"8660160","full_name":"markusfisch/Phapp","owner":"markusfisch","description":"A simple but scalable web application framework for PHP","archived":false,"fork":false,"pushed_at":"2019-10-19T17:54:52.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-11T13:38:07.095Z","etag":null,"topics":["php-framework"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markusfisch.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}},"created_at":"2013-03-08T21:25:01.000Z","updated_at":"2020-03-13T14:30:22.000Z","dependencies_parsed_at":"2022-08-29T15:24:01.156Z","dependency_job_id":null,"html_url":"https://github.com/markusfisch/Phapp","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/markusfisch/Phapp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusfisch%2FPhapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusfisch%2FPhapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusfisch%2FPhapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusfisch%2FPhapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markusfisch","download_url":"https://codeload.github.com/markusfisch/Phapp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusfisch%2FPhapp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262298770,"owners_count":23289603,"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":["php-framework"],"created_at":"2025-06-27T17:06:34.304Z","updated_at":"2025-10-28T23:14:16.103Z","avatar_url":"https://github.com/markusfisch.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Phapp\n=====\n\nA simple but scalable object-oriented web application framework.\n\nHello World\n-----------\n\nA simple example:\n\n\t\u003c?php\n\n\trequire_once 'Phapp.php';\n\n\tclass Hello extends PhappView\n\t{\n\t\tpublic function response()\n\t\t{\n\t\t\treturn 'Hello World.';\n\t\t}\n\t}\n\n\t$app = new Phapp();\n\n\techo $app-\u003eprocess( 'Hello' );\n\nFind this and more complex examples in the\n[samples branch](https://github.com/markusfisch/Phapp/tree/samples).\n\nHow it works\n------------\n\nThe idea is to define a set of view objects that get processed by the main\napplication object.\n\nEvery view object inherits from PhappView which has two main methods you\nshould overwrite. The first is request():\n\n\tpublic function request()\n\t{\n\t\tif( !$_REQUEST['order_number'] )\n\t\t\treturn 'Home';\n\n\t\treturn null;\n\t}\n\nThe purpose of this method is to handle the request and, if required, return\na name of another view that should take over.\n\nThe first view that returns _null_ will get its response() method called to\nrespond to the request:\n\n\tpublic function response()\n\t{\n\t\treturn '\u003ch1\u003eHello\u003c/h1\u003e';\n\t}\n\nHere's a little graph that shows how everything works together:\n\n                +----------------------------+\n                | Name of a PhappView object | \u003c-------------------------+\n                +----------------------------+                           |\n                    |                                                    |\n                    |                                                    |\n    +-- Phapp ------|-------+                                            |\n    |               |       |                                            |\n    |               V       |                                            |\n    | +------------------------+           +-- PhappView ---------+      |\n    | |    Construct object    |  ------\u003e  |                      |      |\n    | +------------------------+           |    Object derived    |      |\n    |               |       |              |    from PhappView    |      |\n    |               V       |              |                      |      |\n    | +------------------------+           +-- request() ---------+      |\n    | |    Call request() on   |           |                      |      |\n    | |       that object      |  ------\u003e  |     Determine if     |      |\n    | +------------------------+           |      this object     |      |\n    |                       |              |      can handle      |      |\n    | +------------------------+    yes?   |     this request     |  no? |\n    | |   request() returned   |  \u003c------  |                      | -----+\n    | |          null          |           +-- response() --------+\n    | |   so call response()   |  ------\u003e  |                      |\n    | |    to get the output   |  \u003c------  |  Generate output for |\n    | +------------------------+    html   |     this request     |\n    |               |       |              |                      |\n    +---------------|-------+              +----------------------+\n                    |\n                    V\n               +----------+\n               | Web page |\n               +----------+\n\nPhapp is very minimal and very small.\nJust have a look at Phapp.php to fully understand its concept.\n\nSubclass to extend\n------------------\n\nSubclass Phapp and PhappView to add methods for data base access,\ninternationalization and stuff like that.\n\nIt's a good idea to set up a base view which contains common methods\nand derive your views from that.\n\nPDO support\n-----------\n\nIf you're using [PDO](http://php.net/manual/en/book.pdo.php)'s,\nyou may inherit your views from PhappPDOView and call query() like this:\n\n\tif( ($result = $this-\u003equery(\n\t\t\"SELECT\n\t\t\tfirst,\n\t\t\tlast\n\t\t\tFROM members\n\t\t\tWHERE last_login = ?\n\t\t\tORDER BY last\",\n\t\t$lastLogin )) )\n\t{\n\t\twhile( ($row = $result-\u003efetch()) )\n\t\t{\n\t\t\t$contents .= \"\u003cli\u003e{$row['first']} {$row['last']}\u003c/li\u003e\";\n\t\t}\n\t}\n\nStay up to date\n---------------\n\nIt's probably best to add Phapp as submodule or\n[subtree](https://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/)\nto your project's repository to be able to update fast and easily.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkusfisch%2Fphapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkusfisch%2Fphapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkusfisch%2Fphapp/lists"}