Kaynağa Gözat

Ajout de methode pour limiter l'affichage en dehors d'une section donnée

feature/section_export
Fabien Normand 1 hafta önce
ebeveyn
işleme
ca38d4f22a
1 değiştirilmiş dosya ile 8 ekleme ve 0 silme
  1. +8
    -0
      Controller/AdminControllerTrait.php

+ 8
- 0
Controller/AdminControllerTrait.php Dosyayı Görüntüle

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Controller;

use App\Entity\Section\Section;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManagerInterface;
use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection;
@@ -59,6 +60,13 @@ trait AdminControllerTrait
}
}

public function configureResponseParametersDisableShowIfNotSection(KeyValueStore $responseParameters, Section $section)
{
if($this->getSectionCurrent() != $section) {
$responseParameters->set('replace_content_with_message', "Vous devez vous rendre sur la section ". $section->getTitle().' pour afficher cette page');
}
}

public function createIndexRepositoryQuery(
SearchDto $searchDto,
EntityDto $entityDto,

Yükleniyor…
İptal
Kaydet