Extract logic from search form template

This removes all logic from the search form Blade template, and extracts
it to the "Controller" level via Sage's filter system. It also adds a
global 'app' filter to hook into, so that the search form data will be
served on every page.
This commit is contained in:
Ben
2018-08-06 13:06:34 -07:00
parent b41047f5a1
commit e898cf1f4d
2 changed files with 21 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
<form role="search" method="get" class="search-form" action="{{ esc_url(home_url('/')) }}">
<form role="search" method="get" class="search-form" action="{{ $sf_action }}">
<label>
<span class="screen-reader-text">{{ _x('Search for:', 'label', 'sage') }}</span>
<input type="search" class="search-field" placeholder="{!! esc_attr_x('Search &hellip;', 'placeholder', 'sage') !!}" value="{{ get_search_query() }}" name="s">
<span class="screen-reader-text">{{ $sf_screen_reader_text }}</span>
<input type="search" class="search-field" placeholder="{!! $sf_placeholder !!}" value="{{ $sf_current_query }}" name="s">
</label>
<input type="submit" class="search-submit" value="{{ esc_attr_x('Search', 'submit button', 'sage') }}">
<input type="submit" class="search-submit" value="{{ $sf_submit_text }}">
</form>