{"id":19931810,"url":"https://github.com/vincentchalnot/sidusadminbundle","last_synced_at":"2025-06-10T18:34:03.558Z","repository":{"id":57050426,"uuid":"52382600","full_name":"VincentChalnot/SidusAdminBundle","owner":"VincentChalnot","description":"Simple and extendable action-based admin management with built-in routing generation","archived":false,"fork":false,"pushed_at":"2024-01-25T15:03:24.000Z","size":163,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"v5.x","last_synced_at":"2024-10-08T19:25:20.826Z","etag":null,"topics":[],"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/VincentChalnot.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":"2016-02-23T18:40:10.000Z","updated_at":"2023-09-01T20:27:18.000Z","dependencies_parsed_at":"2022-08-24T03:40:45.852Z","dependency_job_id":null,"html_url":"https://github.com/VincentChalnot/SidusAdminBundle","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VincentChalnot%2FSidusAdminBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VincentChalnot%2FSidusAdminBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VincentChalnot%2FSidusAdminBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VincentChalnot%2FSidusAdminBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VincentChalnot","download_url":"https://codeload.github.com/VincentChalnot/SidusAdminBundle/tar.gz/refs/heads/v5.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224360236,"owners_count":17298319,"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-11-12T23:08:11.306Z","updated_at":"2024-11-12T23:08:12.134Z","avatar_url":"https://github.com/VincentChalnot.png","language":"PHP","readme":"Sidus/AdminBundle\n================\n\nThe missing link between the controllers, the router component, the forms and the entities.\n\nExample in twig:\n```twig\n\u003ca href=\"{{ admin_path('post', 'list') }}\"\u003eList\u003c/a\u003e\n\u003ca href=\"{{ entity_path(entity, 'edit') }}\"\u003eEdit\u003c/a\u003e\n```\n\n## Warning\n\nThis bundle requires the security component of Symfony, it will enforce access to any entity using the voter.\nThis bundle is easier to use with Doctrine, it can still be used for non-doctrine entities.\n\n## Configuration\n\nSimple example:\n```yaml\nsidus_admin:\n    configurations:\n        post:\n            entity: MyBundle\\Entity\\Post # Class name of your entity\n            prefix: /post # Routing prefix\n            controller_pattern:\n                - 'Sidus\\AdminBundle\\Action\\{{Action}}Action' # Full controller reference\n            template_pattern:\n                - '@SidusAdmin/Action/{{action}}.{{format}}.twig'\n            actions:\n                list:\n                    path:     /list # Routing path\n                edit:\n                    path:     /edit/{id}\n                    form_type: MyBundle\\Form\\Type\\EditPostType # Form type to use in controller\n```\n\n### Configuration reference\n\nAll values are the default one except when specified otherwise.\n\n```yaml\nsidus_admin:\n    admin_class: Sidus\\AdminBundle\\Model\\Admin\n    action_class: Sidus\\AdminBundle\\Model\\Action\n    configurations:\n        \u003cadmin_code\u003e:\n            entity: ~ # REQUIRED: The fully qualified class name of the entity (or the Doctrine's shorter reference)\n            prefix: ~ # REQUIRED: Routing prefix for all actions\n            controller_pattern: [] # The controller reference that will be used to generate routing\n            # Available interpolation variables are:\n            # {{admin}} lowercase first letter admin code\n            # {{Admin}} uppercase first letter admin code\n            # {{action}} lowercase first letter action code\n            # {{Action}} uppercase first letter action code\n            # If you don't set any controller_pattern you will need to set the _controller attribute in the defaults of\n            # each action.\n            template_pattern: [] # The template pattern\n            action_class: # Defaults to main action_class\n            options: {} # You can put anything here\n            permissions: [ ROLE_USER ] # List of permissions required to access the whole admin\n            actions:\n                \u003caction_code\u003e: # The action code needs to match the controller's method name without the \"Action\" suffix\n                    form_type: ~ # Useful in combination with AbstractAdminController::getForm($request, $data)\n                    form_options: ~ # Static form options\n                    template: ~ # Computed by the TemplateResolver using template_pattern if null\n                    permissions: [ ROLE_USER ] # List of permissions required to access the action\n                    # All the following options are used to generate the route for the routing component\n                    # See Symfony doc here: http://symfony.com/doc/current/routing.html\n                    path: ~ # REQUIRED\n                    defaults: ~\n                    requirements: ~\n                    options: ~\n                    host: ~\n                    schemes: ~\n                    methods: ~\n                    condition: ~\n```\n\n## Usage\n\n### Generating routes\n\nWhen routing to an entity, the AdminRouter component will try to fetch missing route parameters from the routing context\nand then from the entity itself, meaning if you name your route parameters accordingly to your entity properties, you\nwon't need to pass any parameter manually.\n\n#### PHP\n```php\n\u003c?php\n/** @var $adminRouter AdminRouter */\nuse Sidus\\AdminBundle\\Routing\\AdminRouter;$adminRouter-\u003egenerateAdminPath('post', 'list');\n$adminRouter-\u003egenerateEntityPath($entity, 'edit');\n```\n\nWhen dealing with multiple admins for a single class, you can use this function instead:\n```php\n\u003c?php\n/** @var $adminRouter AdminRouter */\nuse Sidus\\AdminBundle\\Routing\\AdminRouter;$adminRouter-\u003egenerateAdminEntityPath('post', $entity, 'edit');\n```\n\n#### Twig\n```twig\n\u003ca href=\"{{ admin_path('post', 'list') }}\"\u003eList\u003c/a\u003e\n\u003ca href=\"{{ entity_path(entity, 'edit') }}\"\u003eEdit\u003c/a\u003e\n```\n\nWhen dealing with multiple admins for a single class, you can use this function instead:\n\n```twig\n\u003ca href=\"{{ admin_entity_path('post', entity, 'edit') }}\"\u003eEdit\u003c/a\u003e\n```\n\n#### Additional optional arguments\n\nFor each method, you can pass additional route parameters in the argument just after the action name, you can also set\nthe UrlGeneratorInterface reference type (absolute, relative...).\n```php\n\u003c?php\n/** @var $adminRouter AdminRouter */\nuse Sidus\\AdminBundle\\Routing\\AdminRouter;use Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface;$adminRouter-\u003egenerateAdminEntityPath(\n    'post',\n    $entity,\n    'edit',\n    ['parametrer' =\u003e 'value'],\n    UrlGeneratorInterface::ABSOLUTE_PATH\n);\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincentchalnot%2Fsidusadminbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvincentchalnot%2Fsidusadminbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincentchalnot%2Fsidusadminbundle/lists"}