<?php
// Usage:
// $action = base_path('...'); $placeholder='...'; $q = $_GET['q'] ?? ''; $extra = '...optional html...';
?>
<form method="get" action="<?= e((string)($action ?? '')) ?>" class="row g-2 align-items-end">
  <div class="col-md-9">
    <label class="form-label small text-muted mb-1"><?= e(trans('search')) ?></label>
    <input name="q" class="form-control rounded-4" value="<?= e((string)($q ?? '')) ?>" placeholder="<?= e((string)($placeholder ?? '')) ?>">
  </div>
  <div class="col-md-3 d-grid">
    <button class="btn btn-primary ec-btn rounded-4"><i class="fa-solid fa-magnifying-glass me-2"></i><?= e(trans('search')) ?></button>
  </div>
  <?php if (!empty($extra)): ?>
    <div class="col-12"><?= $extra ?></div>
  <?php endif; ?>
</form>
