定制 shortdark/powercable 二次开发

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

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

shortdark/powercable

Composer 安装命令:

composer require shortdark/powercable

包简介

Checks to see if the current time or start time/date is far enough away from an end date/time.

README 文档

README

Powercable tells you from the start time and end time whether a product that takes n days is able to be ordered. Also, working backwards from the end time, do we have enough time to process the order.

Installation

Install the latest version with

$ composer require shortdark/powercable

Basic Usage

<?php

require_once 'vendor/autoload.php';

$test = new Shortdark\Powercable();

$test->endtime = '1556452800'; // UNIX timestamp for the end time

/*
 * Calculate the latest dates we can start work based on the end time
 */
$test->latestStartTime();
var_dump($test->image_message);

/*
 * Calculate whether someone can order a product that takes n days
 */
$test->earliestEndTime();
var_dump($test->workdays_boolean);

Basic Usage in a Laravel Controller

<?php

use App\Http\Controllers\Controller;
use Shortdark\Powercable;

class MyController extends Controller
{
    public function index(Powercable $power)
    {
        $power->latestStartTime();
        $result = $power->image_message;
        return view('index', compact('result'));
    }
    
}

Then, as $result is an array, to get a representation of the array you could have something like the following in the index.blade.php.

{{ json_encode($result) }}

Author

Neil Ludlow - neil@shortdark.net - https://twitter.com/shortdark

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固