chamilo /
chamilo-lms
| 1 | <?php |
||
| 2 | /* For licensing terms, see /license.txt */ |
||
| 3 | |||
| 4 | namespace Chamilo\CoreBundle\Controller; |
||
| 5 | |||
| 6 | use Chamilo\CoreBundle\Controller\BaseController; |
||
| 7 | use Chamilo\CoreBundle\Entity\CourseRelUser; |
||
| 8 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; |
||
| 9 | use Symfony\Component\HttpFoundation\JsonResponse; |
||
| 10 | use Symfony\Component\HttpFoundation\Request; |
||
| 11 | use Symfony\Component\HttpFoundation\Response; |
||
| 12 | use Symfony\Component\Routing\Annotation\Route; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Class UserController. |
||
| 16 | * |
||
| 17 | * @Route("/user") |
||
| 18 | * |
||
| 19 | * @author Julio Montoya <[email protected]> |
||
| 20 | */ |
||
| 21 | class UserController extends BaseController |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @Route("/{username}", methods={"GET"}) |
||
| 25 | * |
||
| 26 | * @param string $username |
||
| 27 | * |
||
| 28 | * @Template("ChamiloCoreBundle:User:profile.html.twig") |
||
| 29 | * |
||
| 30 | * @return Response |
||
| 31 | */ |
||
| 32 | public function profileAction($username): array |
||
| 33 | { |
||
| 34 | $user = $this->container->get('fos_user.user_manager')->findUserByUsername($username); |
||
| 35 | |||
| 36 | return ['user' => $user]; |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 37 | } |
||
| 38 | } |
||
| 39 |