官术网_书友最值得收藏!

Routing

It all starts with a route, doesn't it? Any interaction with a Drupal 8 website has its beginning in a user (or system) accessing a certain path (or resource). This translates into a route, which maps that resource to a flow that (hopefully) returns a successful response back or at least a graceful failure.

The Drupal 8 routing system is a major shift away from how it was in its previous versions. In Drupal 7 and earlier versions, the routing system was a very Drupal-specific thing (a drupalism, if you will). Many of us remember hook_menu as a staple hook each Drupal developer had to know very well. All of that has been abandoned in Drupal 8 in favor of the Symfony Routing component (http://symfony.com/doc/current/components/routing.html). Also, since I mentioned hook_menu, I will also mention that its other main functions have also been taken over in Drupal 8 by other subsystems, such as plugins.

In this book, we will see how we can define our own route and map it to a controller that will render our page. We will cover a few of the more important route options and take a look at how we can control access to these routes.

主站蜘蛛池模板: 驻马店市| 大厂| 九龙县| 错那县| 达日县| 和田市| 弋阳县| 体育| 深圳市| 赤壁市| 彰武县| 聂荣县| 青海省| 江都市| 福建省| 临沭县| 华宁县| 曲松县| 麦盖提县| 龙海市| 宣威市| 岳阳县| 扬中市| 忻州市| 安阳市| 九江市| 平南县| 西充县| 郓城县| 宁波市| 六安市| 普陀区| 武邑县| 张北县| 平塘县| 姜堰市| 霞浦县| 辽宁省| 砀山县| 舟曲县| 托克逊县|