coursegroup_api_controller extends api_controller
Public SDK API Controller.
Extend this class to expose JSON-first endpoints that leverage the framework routing and middleware without touching Moodle globals directly.
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor with dependency injection.
- contents() : JsonResponse
Properties
$coursegroup_service read-only
private
coursegroup_service
$coursegroup_service
Methods
__construct()
Constructor with dependency injection.
public
__construct(coursegroup_service $coursegroup_service) : mixed
Parameters
- $coursegroup_service : coursegroup_service
-
Injected by the kernel's DI container
contents()
public
contents([int $id = 0 ]) : JsonResponse
Parameters
- $id : int = 0
Tags
Attributes
- #[Route]
- $path: '/coursegroup/{id}/contents'
- $name: 'api_coursegroup_contents'
- $methods: ['GET']