I’m sure that I am missing something very minor here. I have set up a search form that I put in my site/snippets/header.php
snippet:
<form action="<?php echo page('search')->url() ?>">
<input type="search" name="q"><input type="submit" value="Search">
</form>
Here is my rough prototype site/templates/search.php
template
<?php snippet('header') ?>
<section id="search">
<ul>
<?php foreach($results as $result): ?>
<li>
<div>
<a href="<?php echo $result->url() ?>">
<?php echo $result->title()->html() ?>
</a>
</div>
<div>
<?php echo $result->text()->excerpt(100) ?>
</div>
</li>
<?php endforeach ?>
</ul>
</section>
<?php snippet('footer') ?>
And finally my site/controllers/search.php
controller:
<?php
return function($site, $pages, $page) {
$query = get('q');
$results = $site->search($query, 'title|text');
return array(
'query' => $query,
'results' => $results,
);
};
Everything is running smoothly, but I want to be able to insert some text that basically says: Your search did not return any results
or something to that effect on the Search page. How is this done?
Thanks in advance!
Paul B.