Spaces are encoded as "+" in URL style (HTTP definition).

Giving some text without filtering could give you some bad URLs. What about
characters : é, à, ç, %, *

Maybe you should add a slug column to your schema, to get
a-friendly-url-text and use it.

"Hard replacing" the spaces using str_replace(..., url_for()) supposes you
to do the same on the other side : $myArgument = str_replace("_"," ",
$myArgument)

But what about "_" ? They disappear ?

Use slug ;)

Alexandre

2009/11/23 nidkil <stephen.oostenbr...@gmail.com>

> Hi Gareth & Russ,
>
> Thx for your responses guys!
>
> My question was actually triggered by the excersise in jobeet. In the
> tutorial it shows spaces of the generated url replaced by hypens (-).
> In my local installation the spaces in the url are replaced by plusses
> (+). That's what made me wonder if this was a configuration setting
> that determines how spaces are replaced.
>
> Rooster: I checked out the php manual and it does state that spaces
> are replaced by pluses.
>
> I guess the hyphen in the tutorial is a mistake or not?
>
> Regards, Stephen
>
> On 23 nov, 17:52, Gareth McCumskey <gmccums...@gmail.com> wrote:
> > str_replace("+", "_", url_for("path/to/url"));
> >
> > Don't need symfony for everything ;)
> >
> > On Mon, Nov 23, 2009 at 5:44 PM, nidkil <stephen.oostenbr...@gmail.com
> >wrote:
> >
> >
> >
> >
> >
> > > No one willing to help a newbie?
> >
> > > On 22 nov, 20:39, nidkil <stephen.oostenbr...@gmail.com> wrote:
> > > > Hi,
> >
> > > > I'm new to Symfony and busy playing around with the Jobeet tutorial.
> >
> > > > I'm up to the chapter 5 Routing and playing around with the for_url
> > > > statement. I am getting a plus (+) as a replacement for spaces. Is
> > > > there a way to  change this to another character, for example a dash
> > > > (-) or underscore (_)?
> >
> > > > Thx.
> >
> > > --
> >
> > > You received this message because you are subscribed to the Google
> Groups
> > > "symfony users" group.
> > > To post to this group, send email to symfony-us...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> <symfony-users%2bunsubscr...@goog legroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/symfony-users?hl=.
> >
> > --
> > Gareth McCumskeyhttp://garethmccumskey.blogspot.com
> > twitter: @garethmcc
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to symfony-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=.
>
>
>


-- 
Alexandre Salomé -- alexandre.sal...@gmail.com

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.


Reply via email to