raphhh / puppy-static-route
Puppy 框架的静态路由模块
1.0.0
2015-04-11 08:29 UTC
Requires
- php: >=5.4
- raphhh/puppy-application: ~1.0
Requires (Dev)
- phpunit/phpunit: @stable
- raphhh/puppy-template: @dev
This package is auto-updated.
Last update: 2024-08-25 23:03:31 UTC
README
Puppy 框架的静态路由模块。
有关更多信息,请参阅 Puppy 框架。
安装
$ composer require raphhh/puppy-static-route
文档
此模块将 URI 路由到模板文件。路由器会获取请求 URI 并尝试找到关联的模板。
注意,模板文件必须位于目录 "<template.directory.main>/public/" 中。
如果请求 URI 指向目录而不是文件,将搜索默认文件。默认情况下:"
/index.html.twig"。如果模板中找不到文件,则返回 HTTP 404 错误。
配置选项
- 'template.directory.main' => 模板文件的目录路径。
- 'template.file.default' => 如果地址指向目录,则搜索的文件名称。默认:"index"。
- 'template.file.server.extension' => 如果地址指向目录,则搜索的文件扩展名。默认:".html"。
- 'template.file.template.extension' => 添加到文件的模板引擎名称。默认:".twig"。