定制 setono/cron-expression-bundle 二次开发

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

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

setono/cron-expression-bundle

最新稳定版本:v1.9.0

Composer 安装命令:

composer require setono/cron-expression-bundle

包简介

Symfony bundle that integrates dragonmantank/cron-expression

README 文档

README

Latest Version Latest Unstable Version Software License Build Status Code Coverage

Symfony bundle that integrates dragonmantank/cron-expression

Installation

Step 1: Download

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

composer require setono/cron-expression-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the bundle

If you use Symfony Flex it will be enabled automatically. Else you need to add it to the bundles.php.

<?php
// config/bundles.php

return [
    // ...
    Setono\CronExpressionBundle\SetonoCronExpressionBundle::class => ['all' => true],
    // ...
];

Usage

Add to form type

<?php
// src/Form/TaskType.php

namespace App\Form;

use Setono\CronExpressionBundle\Form\Type\CronExpressionType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;

class TaskType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('task')
            ->add('schedule', CronExpressionType::class)
            ->add('save', SubmitType::class)
        ;
    }
}

Add to entity

<?php

declare(strict_types=1);

namespace App\Entity;

use Cron\CronExpression;
use Doctrine\ORM\Mapping as ORM;
use Setono\CronExpressionBundle\Doctrine\DBAL\Types\CronExpressionType;

#[ORM\Entity]
class Task
{
    #[ORM\Column(type: CronExpressionType::CRON_EXPRESSION_TYPE)]
    private CronExpression $schedule;
}

统计信息

  • 总下载量: 179.18k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 25
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 25
  • Watchers: 2
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-26