modnarlluf/twig-exception
Composer 安装命令:
composer require modnarlluf/twig-exception
包简介
Use to make customizables Twig exception pages for routes or specific HTTP status codes
关键字:
README 文档
README
About
Use to make customizables Twig exception pages for routes or specific HTTP status codes.
Features
- Change default error templates from routes and status codes
- Enable or disable custom error templates for debug environnement
Configuration
If you need to add custom route handlers, disable the bundle for some environnements or activate custom template for debug mode, you can do it through the configuration.
kwrz_twig_exception:
enabled: true
with_debug: false
handlers:
- { regex: ^\/admin, template: "MyBundle:Admin:error404.html.twig", status_code: [404] }
- { regex: ^\/admin, template: "MyBundle:Admin:errorDefault.html.twig" }
- { host: ^member\.domain\.tld, regex: ^\/, template: "MyBundle:Member:errorDefault.html.twig" }
- { regex: ^\/, template: "MyBundle:Front:errorDefault.html.twig" }
Pay attention to the order in which your handlers are declared. There are processed in the same order as in the configuration. If you specify the status_code array in an handler row, the error template will be used only if the expected response status code is in this array.
By default, the kwrz_twig_exception.with_debug option is set to false. If you want to view custom error pages in kernel.debug mode, simply set this option to true.
If you want to disable this bundle in some environment, simply set the kwrz_twig_exception.enabled option to false.
Installation (Symfony 3.4+)
Require the modnarlluf/twig-exception package in your composer.json and update your dependencies.
$ composer require "modnarlluf/twig-exception"
modnarlluf/twig-exception 适用场景与选型建议
modnarlluf/twig-exception 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 50 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 03 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「route」 「twig」 「exception」 「view」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 modnarlluf/twig-exception 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 modnarlluf/twig-exception 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 modnarlluf/twig-exception 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Shoot aims to make providing data to your templates more manageable
This Symfony bundle integrates PhpSpreadsheet into Symfony using Twig.
A Twig extension to insert css as inline styles with a tag
Caching and compression for Twig assets (JavaScript and CSS).
Provide a way to secure accesses to all routes of an symfony application.
Write down your routing mapping at one place
统计信息
- 总下载量: 50
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-03-22