定制 tobento/service-helper-function 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-25