chamilo/chamilo-lms

View on GitHub
src/CoreBundle/Controller/BadgeController.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

declare(strict_types=1);

/* For licensing terms, see /license.txt */

namespace Chamilo\CoreBundle\Controller;

use Chamilo\CoreBundle\Traits\ControllerTrait;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;

class BadgeController extends AbstractController
{
    use ControllerTrait;

    #[Route('/badge/{id}', name: 'badge_issued')]
    public function issued(int $id): Response
    {
        return $this->redirect(
            '/main/skills/issued.php?'.http_build_query(['issue' => $id])
        );
    }

    #[Route('/badge/{skillId}/user/{userId}')]
    #[Route('/skill/{skillId}/user/{userId}', name: 'badge_issued_all')]
    public function issuedAll(int $skillId, int $userId): Response
    {
        return $this->redirect(
            '/main/skills/issued_all.php?'.http_build_query(['skill' => $skillId, 'user' => $userId])
        );
    }
}