Hi, I'm trying to pass values having an ampersand... like
http://localhost/cake/cat/TV & Music where "TV & Music" is the
category name and the /cat is actually passed to /Categories/display/
TV & Music.
I added the following in routes.php to achieve the above:
Router::connect('/cat/*', array('controller' => 'Categories',
'action' => 'display'));
For all category names without &, this works fine. But categories
having & fails. In the above example, query happens only for "TV" and
not for "TV & Music". Can some one help me with this?
> Hi, I'm trying to pass values having an ampersand... like
> http://localhost/cake/cat/TV & Music where "TV & Music" is the
> category name and the /cat is actually passed to /Categories/display/
> TV & Music.
> I added the following in routes.php to achieve the above:
> Router::connect('/cat/*', array('controller' => 'Categories',
> 'action' => 'display'));
> For all category names without &, this works fine. But categories
> having & fails. In the above example, query happens only for "TV" and
> not for "TV & Music". Can some one help me with this?
> 1) URL encode your category names
> Or
> 2) refactor to allow category name slugs for URL access to avoid use
> of special characters
> Cheers
> Graham
> On 10/11/2009, at 11:56 AM, "ashok.b" <email2...@gmail.com> wrote:
> > Hi, I'm trying to pass values having an ampersand... like
> >http://localhost/cake/cat/TV& Music where "TV & Music" is the
> > category name and the /cat is actually passed to /Categories/display/
> > TV & Music.
> > I added the following in routes.php to achieve the above:
> > Router::connect('/cat/*', array('controller' => 'Categories',
> > 'action' => 'display'));
> > For all category names without &, this works fine. But categories
> > having & fails. In the above example, query happens only for "TV" and
> > not for "TV & Music". Can some one help me with this?
> Thanks for the reply Graham, I'm actually a newbie to cakephp, can you
> kindly give some guidance code to how to do either 1 or 2?
> On Nov 10, 6:30 am, Graham Weldon <gra...@grahamweldon.com> wrote:
> > You might need to do:
> > 1) URL encode your category names
> > Or
> > 2) refactor to allow category name slugs for URL access to avoid use
> > of special characters
> > Cheers
> > Graham
> > On 10/11/2009, at 11:56 AM, "ashok.b" <email2...@gmail.com> wrote:
> > > Hi, I'm trying to pass values having an ampersand... like
> > >http://localhost/cake/cat/TV&Music where "TV & Music" is the
> > > category name and the /cat is actually passed to /Categories/display/
> > > TV & Music.
> > > I added the following in routes.php to achieve the above:
> > > Router::connect('/cat/*', array('controller' => 'Categories',
> > > 'action' => 'display'));
> > > For all category names without &, this works fine. But categories
> > > having & fails. In the above example, query happens only for "TV" and
> > > not for "TV & Music". Can some one help me with this?
On Thu, Nov 12, 2009 at 8:14 AM, ashok.b <email2...@gmail.com> wrote:
> bump
> On Nov 10, 11:32 am, "ashok.b" <email2...@gmail.com> wrote:
> > Thanks for the reply Graham, I'm actually a newbie to cakephp, can you
> > kindly give some guidance code to how to do either 1 or 2?
> > On Nov 10, 6:30 am, Graham Weldon <gra...@grahamweldon.com> wrote:
> > > You might need to do:
> > > 1) URL encode your category names
> > > Or
> > > 2) refactor to allow category name slugs for URL access to avoid use
> > > of special characters
> > > Cheers
> > > Graham
> > > On 10/11/2009, at 11:56 AM, "ashok.b" <email2...@gmail.com> wrote:
> > > > Hi, I'm trying to pass values having an ampersand... like
> > > >http://localhost/cake/cat/TV&Music where "TV & Music" is the
> > > > category name and the /cat is actually passed to /Categories/display/
> > > > TV & Music.
> > > > I added the following in routes.php to achieve the above:
> > > > Router::connect('/cat/*', array('controller' => 'Categories',
> > > > 'action' => 'display'));
> > > > For all category names without &, this works fine. But categories
> > > > having & fails. In the above example, query happens only for "TV" and
> > > > not for "TV & Music". Can some one help me with this?
> --
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.c om>
> .
> For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=.