Note that there are some explanatory texts on larger screens.

plurals
  1. POZend Framework - long routes(Router)
    primarykey
    data
    text
    <p>I'm already thinking about to start using simple GET string.</p> <p>Or I'm not so good at configuring routes? :)</p> <p>And configuring routes via regex in .htaccess</p> <pre><code>foreach($links as $a) { $Router-&gt;addRoute($a['link'], new Zend_Controller_Router_Route( $a['link'] . '/:page/:ad_id/:photo/:price_from/:price_to/:regions/:rajoni/:towns/:pagasti/:gadi_from/:gadi_to/:augums_from/:augums_to', array ("page" =&gt; 1, "ad_id" =&gt; 0, "photo" =&gt; 0, "price_from" =&gt; 0, "price_to" =&gt; 0, "regions" =&gt; 'def', "rajoni" =&gt; 'def', "towns" =&gt; 'def', "pagasti" =&gt; 'def', "gadi_from" =&gt; 'def', "gadi_to" =&gt; 'def', "augums_from" =&gt; 'def', "augums_to" =&gt; 'def', "department" =&gt; $a['department'], "category" =&gt; '', "link" =&gt; $a['link'], "controller" =&gt; "ads", "action" =&gt; "view", ))); } </code></pre> <p>Please help me to find a right way to use Zend Framework Routes</p> <p>After edit:</p> <p>By the way, is it ok to loop through categories to bind route to them? So urls could be human readable?</p> <p>Or better to stick to .htaccess file configuration? But I still didn't figured out, how to make human readable urls without adding number for categories to regex.</p> <pre><code> RewriteRule ^.*-d([0-9]+)/.*-c([0-9]+)/page-([0-9]+)/?$ index.php?DepartmentId=$1&amp;CategoryId=$2&amp;Page=$3 [L] RewriteRule ^.*-d([0-9]+)/.*-c([0-9]+)/?$ index.php?DepartmentId=$1&amp;CategoryId=$2 [L] </code></pre> <p>The only way I have figured out, is to pass actual name of category as value and on server side compare it with array of category names.</p> <p>Or there is a better way?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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