tobento/service-helper-function
最新稳定版本:2.0
Composer 安装命令:
composer require tobento/service-helper-function
包简介
Support for helper functions management.
README 文档
README
With the HelperFunction Service you can easily manage your helper functions.
Table of Contents
Getting started
Add the latest version of the HelperFunction service running this command.
composer require tobento/service-helper-function
Requirements
- PHP 8.4 or greater
Highlights
- Framework-agnostic, will work with any project
Example
Here is a example of how to use the HelperFunction service.
// Create Functions. $functions = new Functions(); // Set any data for later usage for your functions. $functions->set('sitename', 'Your Sitename'); // Register a function file. $functions->register(__DIR__.'/functions.php'); // Calling the function registered. var_dump(sitename()); // string(13) "Your Sitename" // Get the key set. $keys = $functions->getKeys(); // ['sitename']
functions.php file example.
use Tobento\Service\HelperFunction\Functions; if (!function_exists('sitename')) { function sitename(): string { // Get the data from the Functions. return Functions::get('sitename'); } }
Credits
统计信息
- 总下载量: 271
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-25