local/modules/HookContact/Hook/FrontHook.php line 25

  1. <?php
  2. /*
  3.  * This file is part of the Thelia package.
  4.  * http://www.thelia.net
  5.  *
  6.  * (c) OpenStudio <info@thelia.net>
  7.  *
  8.  * For the full copyright and license information, please view the LICENSE
  9.  * file that was distributed with this source code.
  10.  */
  11. namespace HookContact\Hook;
  12. use Thelia\Core\Event\Hook\HookRenderBlockEvent;
  13. use Thelia\Core\Hook\BaseHook;
  14. /**
  15.  * Class FrontHook.
  16.  *
  17.  * @author Julien Chanséaume <jchanseaume@openstudio.fr>
  18.  */
  19. class FrontHook extends BaseHook
  20. {
  21.     public function onMainFooterBody(HookRenderBlockEvent $event): void
  22.     {
  23.         $content trim($this->render('main-footer-body.html'));
  24.         if ('' != $content) {
  25.             $event->add(
  26.                 [
  27.                     'id' => 'contact-footer-body',
  28.                     'class' => 'contact',
  29.                     'title' => $this->trans('Contact', [], 'hookcontact'),
  30.                     'content' => $content,
  31.                 ]
  32.             );
  33.         }
  34.     }
  35. }