Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/src/CoreBundle/Controller/EditorController.php

44 lines
1.2 KiB

<?php
declare(strict_types=1);
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Controller;
use Chamilo\CoreBundle\Component\Editor\CkEditor\CkEditor;
use Chamilo\CoreBundle\Traits\ControllerTrait;
use Chamilo\CoreBundle\Traits\CourseControllerTrait;
use Chamilo\CoreBundle\Traits\ResourceControllerTrait;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
#[Route('/editor')]
class EditorController extends BaseController
{
use ControllerTrait;
use CourseControllerTrait;
use ResourceControllerTrait;
/**
* Get templates (left column when creating a document).
*/
#[Route(path: '/templates', methods: ['GET'], name: 'editor_templates')]
public function editorTemplates(TranslatorInterface $translator, RouterInterface $router): Response
{
$editor = new CkEditor(
$translator,
$router
);
$templates = $editor->simpleFormatTemplates();
return $this->render(
'@ChamiloCore/Editor/templates.html.twig',
[
'templates' => $templates,
]
);
}
}