Note that there are some explanatory texts on larger screens.

plurals
  1. POSymfony, url_for search Parameters
    text
    copied!<p>I'm currently extending a Site and do not have much experience with symfony.</p> <p>Currently there is a Search-Form which looks like this:</p> <pre><code>&lt;form id="search_huts_form" action="&lt;?php echo url_for('hut/search') ?&gt;" method="get"&gt; &lt;fieldset&gt; &lt;legend&gt;&lt;strong&gt;&lt;?php echo __('Search huts') ?&gt;&lt;/strong&gt;&lt;/legend&gt; &lt;table id="spielplantabelle"&gt; &lt;tr&gt; &lt;td&gt;&lt;?php echo __('Your arrival date?') ?&gt;&lt;/td&gt; &lt;td&gt; &lt;select name="arrival"&gt; &lt;option value=""&gt;&lt;?php echo __('no preference') ?&gt;&lt;/option&gt; &lt;?php foreach ($checkInDates as $date): ?&gt; &lt;option value="&lt;?php echo $date ?&gt;"&gt;&lt;?php echo $date ?&gt;&lt;/option&gt; &lt;?php endforeach; ?&gt; &lt;/select&gt; &lt;/table&gt; &lt;input type="submit" value="&lt;?php echo __('Search') ?&gt;" name="Submit" class="inputbuchen" /&gt; &lt;/fieldset&gt; &lt;/form&gt; </code></pre> <p>Now I have to create a list of Categories below the search form with special offers which can also be found with the search function used in the form. This is what I have so far:</p> <pre><code>&lt;ul&gt; &lt;?php foreach ($types as $typ): ?&gt; &lt;?php if (preg_match('#[0-9]#',$typ)): ?&gt; &lt;li&gt; &lt;a href="&lt;?php echo url_for('hut/search') ?&gt;"&gt;&lt;?php echo($typ) ?&gt;&lt;/a&gt; &lt;/li&gt; &lt;?php endif; ?&gt; &lt;?php endforeach; ?&gt; &lt;/ul&gt; </code></pre> <p>The links correctly forward to the search page but I have no idea hot to set parameters based on the link a user clicks. Is this possible?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload