src/Twig/Components/Alert.php line 7

Open in your IDE?
  1. <?php
  2. namespace App\Twig\Components;
  3. use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;
  4. #[AsTwigComponent]
  5. final class Alert
  6. {
  7. public string $type = 'info';
  8. public ?string $titre = null;
  9. public function getIcone(): string
  10. {
  11. return match ($this->type) {
  12. 'danger' => 'fa-times-circle',
  13. 'warning' => 'fa-exclamation-circle',
  14. 'info' => 'fa-info-circle',
  15. 'success' => 'fa-check-circle',
  16. default => 'fa-info-circle',
  17. };
  18. }
  19. }