详细介绍Drupal8模块开发,添加一个routing文件,添加链接、标题等。回到你的模块的根目录中 ,也就是.info.yml所在的目录,添加一个新文件,命名为hello_world.routing.yml,编写如下代码
hello_world.content:
path: '/hello'
defaults:
_controller: '\Drupal\hello_world\Controller\HelloController::content'
_title: 'Hello World'
requirements:
_permission: 'access content'注意你在routing预留的空间,在hello_world.content中的第一行的“hello_world”不是必须使用机器名,尽管如此,为了为了顺利通过routing和menu files,最好这样,hello_world.content 将在下一章节中被使用到,添加一个菜单链接

