Saturday, December 3, 2011

Re: how to get url by giving the controller name, action name and parameters?

you probably want to use Router::url()


On 3 Dez., 14:22, Todong <gbstac...@gmail.com> wrote:
> Hi, everyone!
>
> I know HtmlHelper::link() can generate a link whose url is generated
> by an array containing controller, action and parameters
> e.g.
> HtmlHelper::link('book', array('controller'=>'books',
> 'action'=>'view', 4)) will output:
> <a href=".../books/view/4">book</a>
>
> Now I wanna get the only the url by giving the controller,action and
> parameters.
> getUrl(array('controller'=>'books', 'action'=>'view', 4))  -->  ".../
> books/view/4"
> Is such API existed?
>
> Any suggestion is appreciated.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: