I'm trying to take the jobeet tutorial, and i'm stuck with a problem of url formating :
In the tutorial, the "pretty" url is "/job/sensio-labs/paris-france/1/web-developer" whereas in my case, I get "job/Sensio+Labs/Paris%2C+France/1/Web+Developer".
If I try to get each variable separately (getCompany(), getLocation()...) they are ok. But when they are formated by url_for(), spaces are replaced by plus signs and commas are replaced by '%2'
Here is my routing.yml :
- Code: Select all
# default rules
job:
url: /job/:company/:location/:id/:position
param: { module: job, action: show }
homepage:
url: /
param: { module: job, action: index }
default_index:
url: /:module
param: { action: index }
default:
url: /:module/:action/*
and my indexSuccess.php :
- Code: Select all
<?php use_stylesheet('jobs.css') ?>
<div id="jobs">
<table class="jobs">
<?php foreach ($jobeet_job_list as $i => $job): ?>
<tr class="<?php echo fmod($i, 2) ? 'even' : 'odd' ?>">
<td class="location"><?php echo $job->getLocation() ?></td>
<td class="position">
<a href="<?php echo url_for('job/show?id='.$job->getId().'&company='.$job->getCompany().'&location='.$job->getLocation().'&position='.$job->getPosition()) ?>">
<?php echo $job->getPosition() ?>
</a>
</td>
<td class="company"><?php echo $job->getCompany() ?></td>
</tr>
<?php endforeach; ?>
</table>
</div>
Maybe there is something I don't get.
Thank you
