form.mini.phtml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. ?>
  8. <?php
  9. /** @var $block \Magento\Framework\View\Element\Template */
  10. /** @var $helper \Magento\Search\Helper\Data */
  11. $helper = $this->helper(\Magento\Search\Helper\Data::class);
  12. ?>
  13. <div class="block block-search">
  14. <div class="block block-title"><strong><?= /* @escapeNotVerified */ __('Search') ?></strong></div>
  15. <div class="block block-content">
  16. <form class="form minisearch" id="search_mini_form" action="<?= /* @escapeNotVerified */ $helper->getResultUrl() ?>" method="get">
  17. <div class="field search">
  18. <label class="label" for="search" data-role="minisearch-label">
  19. <span><?= /* @escapeNotVerified */ __('Search') ?></span>
  20. </label>
  21. <div class="control">
  22. <input id="search"
  23. data-mage-init='{"quickSearch":{
  24. "formSelector":"#search_mini_form",
  25. "url":"<?= /* @escapeNotVerified */ $helper->getSuggestUrl()?>",
  26. "destinationSelector":"#search_autocomplete"}
  27. }'
  28. type="text"
  29. name="<?= /* @escapeNotVerified */ $helper->getQueryParamName() ?>"
  30. value="<?= /* @escapeNotVerified */ $helper->getEscapedQueryText() ?>"
  31. placeholder="<?= /* @escapeNotVerified */ __('Search entire store here...') ?>"
  32. class="input-text"
  33. maxlength="<?= /* @escapeNotVerified */ $helper->getMaxQueryLength() ?>"
  34. role="combobox"
  35. aria-haspopup="false"
  36. aria-autocomplete="both"
  37. autocomplete="off"/>
  38. <div id="search_autocomplete" class="search-autocomplete"></div>
  39. <?= $block->getChildHtml() ?>
  40. </div>
  41. </div>
  42. <div class="actions">
  43. <button type="submit"
  44. title="<?= $block->escapeHtml(__('Search')) ?>"
  45. class="action search">
  46. <span><?= /* @escapeNotVerified */ __('Search') ?></span>
  47. </button>
  48. </div>
  49. </form>
  50. </div>
  51. </div>