{"id":16171366,"url":"https://github.com/maniator/smallfry","last_synced_at":"2025-03-19T00:30:39.658Z","repository":{"id":146693675,"uuid":"2475698","full_name":"maniator/SmallFry","owner":"maniator","description":"SmallFry PHP Framework","archived":false,"fork":false,"pushed_at":"2013-08-28T12:54:43.000Z","size":732,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T01:04:45.940Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://maniator.github.com/SmallFry/","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/maniator.png","metadata":{"files":{"readme":"README.markdown","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":"2011-09-28T15:12:33.000Z","updated_at":"2022-09-07T11:10:39.000Z","dependencies_parsed_at":"2023-03-24T12:28:00.755Z","dependency_job_id":null,"html_url":"https://github.com/maniator/SmallFry","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maniator%2FSmallFry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maniator%2FSmallFry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maniator%2FSmallFry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maniator%2FSmallFry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maniator","download_url":"https://codeload.github.com/maniator/SmallFry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244331593,"owners_count":20435963,"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-10-10T03:21:54.177Z","updated_at":"2025-03-19T00:30:39.225Z","avatar_url":"https://github.com/maniator.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"SmallFry PHP Library\n==\n\n###Configuration:\nPut all configuration into in the `/smallFry/config/config.ini` file and set ROOTs in the `AppConfig.php` file\n\nTo get something from the configuration you can do when inside a Model or Controller:\n\n\t\t$this-\u003eCONFIG-\u003eget('CONFIG_VARIABLE'); \n\n###Controller:\nPut all controllers in the `/controller` folder\n\nAn example of a controller called `Test`:\n\n    namespace SmallFry\\Controller;\n    \n    class TestController extends \\SmallFry\\lib\\AppController {\n    \tprotected $name = 'Test';\n    \t\n    \t//pages go here\n    \tfunction index(){\n    \t\t$this-\u003etemplate-\u003eset('test', 'hello there');\n    \t}\n    }\n###Views:\nPut all views in the `/view` folder with a directory for every different controller:\n\nThe view for the `Test` controller (located in `/view/test/index.stp`):\n\n\t\techo $test;\n\t\t\nThis will display to the user when they go to `http://localhost/index.php/Test/index`:\n\n\t\thello there\n\n\t\t \n###MySQL and Models:\nInside of the controller class you can do mysql queries  \nThe object to use is `$this-\u003eModelName` which is the model that handles all database queries.\n\nFor example (a raw mysql example):\n\n\t\tnamespace SmallFry\\Controller;\n        \n    \tclass TestController extends \\SmallFry\\lib\\AppController {\n\t\t\tprotected $name = 'Test';\n\t\t\t\n\t\t\tfunction index(){\n\t\t\t\t$rows = array();\n\t\t\t\t$results = $this-\u003eTest-\u003equeryit('SELECT * FROM TABLE'); // one way to use a model to query the database\n\t\t\t\tforeach($results as $row) {\n\t\t\t\t\t$rows[] = $row;\n\t\t\t\t}\n\t\t\t\t$this-\u003etemplate-\u003eset('rows', $rows); //for use in the view\n\t\t\t}\n\t\t}\n\t\t\nIn order to use the following example you have to create a `Model` that goes with the current controller in the `model` directory:\n\n\t\tnamespace SmallFry\\Model;\n        \n        class Test extends \\SmallFry\\lib\\AppModel {\n\n\t\t}\n\t\t\nThis model will query from the `tests` table if one is **not** doing raw MySQL statements.\n\nThis example selects all records from the `tests` table in the database:\n\n\t\tnamespace SmallFry\\Controller;\n        \n        class TestController extends \\SmallFry\\lib\\AppController {\n\t\t\tprotected $name = 'Test';\n\t\t\t\n\t\t\tfunction index(){\n\t\t\t\t$rows = array();\n\t\t\t\t$results = $this-\u003eTest-\u003eselectAll();\n\t\t\t\tforeach($results as $row) {\n\t\t\t\t\t$rows[] = $row;\n\t\t\t\t}\n\t\t\t\t$this-\u003etemplate-\u003eset('rows', $rows); //for use in the view\n\t\t\t}\n\t\t}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaniator%2Fsmallfry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaniator%2Fsmallfry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaniator%2Fsmallfry/lists"}