<commit_before><?php

namespace SmartCore\Module\Slider\Controller;

use SmartCore\Bundle\CMSBundle\Module\NodeTrait;
use SmartCore\Module\Slider\Entity\Slider;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class SliderController extends Controller
{
    use NodeTrait;

    /**
     * @var int
     */
    protected $slider_id;

    /**
     * @param  Request $request
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function indexAction(Request $request)
    {
        if (null === $this->slider_id) {
            return new Response();
        }

        /** @var Slider $slider */
        $slider = $this->get('slidermodule.entity.slider_repository')->find($this->slider_id);

        return $this->render('SliderModule::'.$slider->getLibrary().'.html.twig', [
            'slider'  => $slider,
            // @todo настройку места хранения картинок, лучше в медиалибе!.
            'imgPath' => $request->getBasePath() . '/' . $this->get('smart_module.slider')->getWebPath(),<commit_msg>Фронт-енд кнопка на управление слайдером<commit_after><?php

namespace SmartCore\Module\Slider\Controller;

use SmartCore\Bundle\CMSBundle\Module\NodeTrait;
use SmartCore\Module\Slider\Entity\Slider;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class SliderController extends Controller
{
    use NodeTrait;

    /**
     * @var int
     */
    protected $slider_id;

    /**
     * @param  Request $request
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function indexAction(Request $request)
    {
        if (null === $this->slider_id) {
            return new Response();
        }

        /** @var Slider $slider */
        $slider = $this->get('slidermodule.entity.slider_repository')->find($this->slider_id);

        $this->node->addFrontControl('manage_slider', [
            'default' => true,
            'title'   => 'Управление слайдами',
            'uri'     => $this->generateUrl('smart_module.slider.admin_slider', ['id' => $this->slider_id]),
        ]);

        return $this->render('SliderModule::'.$slider->getLibrary().'.html.twig', [
            'slider'  => $slider,
            // @todo настройку места хранения картинок, лучше в медиалибе!.
            'imgPath' => $request->getBasePath() . '/' . $this->get('smart_module.slider')->getWebPath(),
{'fraction_non_alphanumeric': 0.1457840819542947, 'fraction_numerical': 0.0, 'mean_word_length': 2.948678071539658, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1691183', 'n_tokens_mistral': 764, 'n_tokens_neox': 782, 'n_words': 129}