{"id":13343472,"url":"https://github.com/TheAdnan/Yii1-API-controller","last_synced_at":"2025-03-12T05:30:23.760Z","repository":{"id":79678458,"uuid":"106403282","full_name":"TheAdnan/Yii1-API-controller","owner":"TheAdnan","description":"Template for API controller in Yii","archived":false,"fork":false,"pushed_at":"2017-10-10T11:19:38.000Z","size":4,"stargazers_count":1,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T09:49:23.843Z","etag":null,"topics":["api","api-rest","php","php-api","yii","yii1","yii2"],"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/TheAdnan.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":"2017-10-10T10:35:10.000Z","updated_at":"2021-10-12T09:35:16.000Z","dependencies_parsed_at":"2023-05-14T12:00:17.335Z","dependency_job_id":null,"html_url":"https://github.com/TheAdnan/Yii1-API-controller","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/TheAdnan%2FYii1-API-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAdnan%2FYii1-API-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAdnan%2FYii1-API-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAdnan%2FYii1-API-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheAdnan","download_url":"https://codeload.github.com/TheAdnan/Yii1-API-controller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243165525,"owners_count":20246721,"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":["api","api-rest","php","php-api","yii","yii1","yii2"],"created_at":"2024-07-29T19:31:22.282Z","updated_at":"2025-03-12T05:30:23.755Z","avatar_url":"https://github.com/TheAdnan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yii1 REST API controller\n_Template for REST API controller in Yii 1_\n\n## Usage\n\n* Add the *ApiController.php* file to your controllers folder\n* Change the `APPLICATION_ID`, and add your models in each action in the switch-case statement (_remove the MyModel example before that_)\n* Open the *protected/config/main.php* file and add this to your configuration:\n```\n'urlManager' =\u003e array(\n            'urlFormat' =\u003e 'path',\n            'showScriptName' =\u003e false,\n            'caseSensitive' =\u003e true,\n            'rules' =\u003e array(\n                //API rules\n                array('api/list', 'pattern'=\u003e'api/\u003cmodel\u003e', 'verb'=\u003e'GET'),\n                array('api/view', 'pattern'=\u003e'api/\u003cmodel\u003e/\u003cid:\\d+\u003e', 'verb'=\u003e'GET'),\n                array('api/update', 'pattern'=\u003e'api/\u003cmodel\u003e/\u003cid:\\d+\u003e', 'verb'=\u003e'PUT'),\n                array('api/delete', 'pattern'=\u003e'api/\u003cmodel\u003e/\u003cid:\\d+\u003e', 'verb'=\u003e'DELETE'),\n                array('api/create', 'pattern'=\u003e'api/\u003cmodel\u003e', 'verb'=\u003e'POST'),\n            ),\n        ), \n ```      \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheAdnan%2FYii1-API-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTheAdnan%2FYii1-API-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheAdnan%2FYii1-API-controller/lists"}