Skip to content

Conversation

@markstory
Copy link
Member

match.
* ``Cake\Routing\RouteBuilder`` now has methods to create routes for
specific HTTP methods. e.g ``get()`` and ``post()``.
* ``Cake\Routing\RouteBuilder::loadPlugin()`` was added.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the deprecation of Plugin::routes() missing? Or don't we deprecate it now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking we don't deprecate it based on the discussion we had about making plugin routes more complicated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Thank you.

en/plugins.rst Outdated
'ContactManager',
['path' => '/contact-manager'],
function ($routes) {
$routes->fallbacks(DashedRoute::class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be add one plugin specific rule plus the fallbacks? Might help envision what one can do with it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

en/plugins.rst Outdated
}
);

The above will connect default routes for you plugin. You can customize this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add another route, this would need to change a bit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"for youR plugin"

en/plugins.rst Outdated

Router::scope('/', function ($routes) {
// Connect other routes.
$routes->scope('/a', function ($routes) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be not /a...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you suggest?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be a locale, like de_DE or may be api as it was used on https://book.cakephp.org/3.0/en/development/routing.html#using-named-routes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a /backend path segment.

en/plugins.rst Outdated
});
});

The above would result in URLs like ``/a/contact_manager/contacts``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/a ...


If you are using ``Plugin::loadAll()`` ensure that routes are loaded::

Plugin::loadAll(['routes' => true]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, we do not recommend this anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate loadAll() personally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me, as it is mentioned in other places on that page, anyway.

Copy link
Member

@ravage84 ravage84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

@markstory markstory merged commit b47c7cc into 3.next Jun 14, 2017
@markstory markstory deleted the 3next-pluginload branch June 14, 2017 03:43
HavokInspiration added a commit that referenced this pull request Jul 10, 2017
okinaka added a commit to okinaka/docs that referenced this pull request Aug 15, 2017
okinaka added a commit to okinaka/docs that referenced this pull request Aug 15, 2017
chinpei215 added a commit that referenced this pull request Aug 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants