setono/cron-expression-bundle

Symfony bundle that integrates dragonmantank/cron-expression

Maintainers

πŸ‘ loevgaard

Package info

github.com/Setono/CronExpressionBundle

Type:symfony-bundle

pkg:composer/setono/cron-expression-bundle

Statistics

Installs: 202 850

Dependents: 3

Suggesters: 0

Stars: 25

Open Issues: 2

v1.10.0 2025-12-02 15:54 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT e763e4f5d5171dfffc1c1d958a9698439753b2bf

  • Joachim LΓΈvgaard <joachim.woop@loevgaard.dk>

This package is auto-updated.

Last update: 2026-06-15 11:22:33 UTC


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;
}