Resource map accessor #391

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

vesln commented Jan 2, 2012

At this point there is no way to set custom resourceMap, without extending the Router. So, for example if you want the PUT /my-controller/:id to be pointed to MyController::update there is no easy way to do it. That's why I think that resourceMap accessor will be pretty useful.

Member

ceeram commented Jan 2, 2012

How about using:

<?php
Router::connect(
    "/:controller/:id",
    array("action" => "update", "[method]" => "PUT"),
    array("id" => "[0-9]+")
);
?>

Also please dont target pull request against master, base bugfixes against current development branch, base new features against development branch for next version(2.1)

Personally i would like such thing, as i ran into the same thing just this week.

Contributor

vesln commented Jan 2, 2012

It's definitely a good option. But my discomfort with that it will be global for all routes.

Owner

markstory commented Jan 2, 2012

Could you make the target branch for the pull request 2.1? We don't merge new features onto the master branch, as it always reflects the last stable release.

Other than that it looks like a reasonable change to me.

Contributor

vesln commented Jan 2, 2012

Thank you @ceeram. The new pull request is here - #392

vesln closed this Jan 2, 2012

Contributor

vesln commented Jan 2, 2012

@markstory Sorry for that. I just sent a new pull request.

vesln referenced this pull request Sep 30, 2013

Merged

Resource map #392

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment