mako / helpers
此包已弃用且不再维护。未建议替代包。
Mako框架的辅助函数集合
4.0.1
2022-02-17 08:53 UTC
Requires
- php: >=7.4.0
Requires (Dev)
- mako/framework: ^8.0.0-dev
- mockery/mockery: ^1.4.4
- phpunit/phpunit: ^9.5.10
README
这是什么?
一组方便的辅助函数,旨在在您的视图中使用。
| 函数 | 描述 |
|---|---|
| app() | 返回应用程序实例 |
| config() | 返回mako\config\Config实例 |
| container() | 返回mako\syringe\Container实例 |
| cookie($name, $default = null) | 返回cookie值或不存在时返回null |
| flash($key, $default = null) | 从会话中返回闪存值 |
| gatekeeper($adapterName = null) | 返回门卫适配器实例 |
| humanizer() | 返回mako\utility\Humanizer实例 |
| i18n() | 返回mako\i18n\I18n实例 |
| one_time_token() | 返回一个随机安全令牌 |
| pusher() | 返回mako\pusher\Pusher实例 |
| request() | 返回mako\http\Request实例 |
| session() | 返回mako\session\Session实例 |
| signed_cookie($name, $default = null) | 返回cookie值或不存在时返回null |
| token() | 返回会话令牌 |
| url() | 返回mako\http\routing\URLBuilder实例 |
| user($adapterName = null) | 返回活动用户或未设置时返回null |
仅当您已安装mako/pusher包且必须使用所提供的中间件时,
pusher函数才会工作。
要求
Mako 8.0或更高版本。
安装
composer require mako/helpers