[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/layouts/joomla/searchtools/default/ -> filters.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  Layout
   6   *
   7   * @copyright   (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  defined('_JEXEC') or die;
  12  
  13  use Joomla\CMS\Factory;
  14  use Joomla\CMS\Form\FormHelper;
  15  
  16  $data = $displayData;
  17  
  18  // Load the form filters
  19  $filters = $data['view']->filterForm->getGroup('filter');
  20  
  21  /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
  22  $wa = Factory::getApplication()->getDocument()->getWebAssetManager();
  23  
  24  ?>
  25  <?php if ($filters) : ?>
  26      <?php foreach ($filters as $fieldName => $field) : ?>
  27          <?php if ($fieldName !== 'filter_search') : ?>
  28              <?php $dataShowOn = ''; ?>
  29              <?php if ($field->showon) : ?>
  30                  <?php $wa->useScript('showon'); ?>
  31                  <?php $dataShowOn = " data-showon='" . json_encode(FormHelper::parseShowOnConditions($field->showon, $field->formControl, $field->group)) . "'"; ?>
  32              <?php endif; ?>
  33              <div class="js-stools-field-filter"<?php echo $dataShowOn; ?>>
  34                  <span class="visually-hidden"><?php echo $field->label; ?></span>
  35                  <?php echo $field->input; ?>
  36              </div>
  37          <?php endif; ?>
  38      <?php endforeach; ?>
  39  <?php endif; ?>


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer