I want to have an url like /posts/5/edit. I want to go to the PostEdit
controller with 5 as parameter. Is this possible?
Thanks.
Yeah I aware of that part, but embracing HTTP the following seems more
logical to me:
Imagine the following url:
/blog/posts/5/edit
Posts belongs to a Blog
5 belongs to a Posts collection
Edit belongs to the My-First-Post
Am I wrong in this mindset? :-)
Thanks for thinking with me.
Don
> --
> You received this message because you are subscribed to the Google Groups "sphoof" group.
>
> post: sph...@googlegroups.com.
> Unsubscribe: sphoof+un...@googlegroups.com
> Options: http://groups.google.com/group/sphoof?hl=en
> Docs: http://sphoof.nl/
>
Thanks.
Don
On 04/04/2011 11:45 AM, Don Pinkster wrote:
> Yeah I aware of that part, but embracing HTTP the following seems more
> logical to me:
>
> Imagine the following url:
> /blog/posts/5/edit
>
> Posts belongs to a Blog
> 5 belongs to a Posts collection
> Edit belongs to the My-First-Post
>
> Am I wrong in this mindset? :-)
Sorry to say, but yes, the opposite is true. You see, in HTTP every
segment of a URL should point to a *resource*. In your example, the blog
itself would be a resource, namely, a collection of posts. The post
itself would also be a resource. "edit", however, is a verb, not a noun,
so it isn't a resource. The "edit" _action_ would be yielded by
appending the ?edit query parameter, which will result in calling
getEdit( ) *on the resource*.
It would be rather trivial to implement ($this->context->name( ) would
yield "5" in your examplary URL), but I would advice against it.
Cheers,
Berry.
Don