{"id":15296379,"url":"https://github.com/00f100/fcphp-controller","last_synced_at":"2025-07-04T16:34:07.915Z","repository":{"id":56893965,"uuid":"144512154","full_name":"00F100/fcphp-controller","owner":"00F100","description":"Abstract class to FcPhp Controllers","archived":false,"fork":false,"pushed_at":"2018-08-17T03:05:27.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-27T19:46:12.898Z","etag":null,"topics":["controller","fcphp","fcphp-controller","php7","php72"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/00F100.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":"2018-08-13T00:49:52.000Z","updated_at":"2018-08-17T03:05:28.000Z","dependencies_parsed_at":"2022-08-20T16:10:48.207Z","dependency_job_id":null,"html_url":"https://github.com/00F100/fcphp-controller","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/00F100/fcphp-controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/00F100","download_url":"https://codeload.github.com/00F100/fcphp-controller/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-controller/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263577253,"owners_count":23483130,"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":["controller","fcphp","fcphp-controller","php7","php72"],"created_at":"2024-09-30T18:10:18.547Z","updated_at":"2025-07-04T16:34:07.861Z","avatar_url":"https://github.com/00F100.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FcPhp Controller\n\nAbstract class to Controller FcPhp\n\n[![Build Status](https://travis-ci.org/00F100/fcphp-controller.svg?branch=master)](https://travis-ci.org/00F100/fcphp-controller) [![codecov](https://codecov.io/gh/00F100/fcphp-controller/branch/master/graph/badge.svg)](https://codecov.io/gh/00F100/fcphp-controller)\n\n[![PHP Version](https://img.shields.io/packagist/php-v/00f100/fcphp-controller.svg)](https://packagist.org/packages/00F100/fcphp-controller) [![Packagist Version](https://img.shields.io/packagist/v/00f100/fcphp-controller.svg)](https://packagist.org/packages/00F100/fcphp-controller) [![Total Downloads](https://poser.pugx.org/00F100/fcphp-controller/downloads)](https://packagist.org/packages/00F100/fcphp-controller)\n\n## How to install\n\nComposer:\n```sh\n$ composer require 00f100/fcphp-controller\n```\n\nor add in composer.json\n```json\n{\n    \"require\": {\n        \"00f100/fcphp-controller\": \"*\"\n    }\n}\n```\n\n## How to use\n\nExtends your controller from [FcPhp Controller](https://github.com/00F100/fcphp-controller) and add your services into Controller using contruct method. After call to service using \"getService()\" method.\n\n```php\n\nnamespace Example\n{\n    use FcPhp\\Controller\\Controller;\n\n    class ExampleController extends Controller\n    {\n        public function __construct($userService, $profileService, $addressService)\n        {\n            $this-\u003esetService('user', $userService);\n            $this-\u003esetService('profile', $profileService);\n            $this-\u003esetService('address', $addressService);\n        }\n\n        public function findUsers()\n        {\n            return $this-\u003egetService('user')-\u003efindAll();\n        }\n\n        public function findProfiles()\n        {\n            return $this-\u003egetService('profile')-\u003efindAll();\n        }\n\n        public function findAddresses()\n        {\n            return $this-\u003egetService('address')-\u003efindAll();\n        }\n    }\n}\n\n```\n\n## Controller Callback\n\n```php\n\nuse Example\\ExampleController;\n\n$instance = new ExampleController(UserService(), ProfileService(), AddressService());\n\n// Callback on find service using \"getService()\"...\n$instance-\u003ecallback('callbackService', function(string $service, $instance) {\n\n    // Your code here...\n\n});\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F00f100%2Ffcphp-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F00f100%2Ffcphp-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F00f100%2Ffcphp-controller/lists"}