PHPackages                             skie/rule-flow - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. skie/rule-flow

ActiveCakephp-plugin[Framework](/categories/framework)

skie/rule-flow
==============

RuleFlow plugin for CakePHP

1.0.0(11mo ago)1621↓29.2%MITPHPPHP &gt;=8.3CI passing

Since Jun 12Pushed 11mo agoCompare

[ Source](https://github.com/skie/rule-flow)[ Packagist](https://packagist.org/packages/skie/rule-flow)[ RSS](/packages/skie-rule-flow/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

RuleFlow Plugin for CakePHP
===========================

[](#ruleflow-plugin-for-cakephp)

[![Latest Stable Version](https://camo.githubusercontent.com/60d5388d3915c1294dc21f4253a4264861ae0be7d113482ebb3561782d8d112f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736b69652f72756c652d666c6f772e737667)](https://packagist.org/packages/skie/rule-flow)[![Total Downloads](https://camo.githubusercontent.com/851a42a6cc49260afebd253c9e2c4a78bb67613f51fe1bc48e4922eab297b9e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736b69652f72756c652d666c6f772e737667)](https://packagist.org/packages/skie/rule-flow)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)[![Build Status](https://camo.githubusercontent.com/40cca43c1d297784afe14f81927fc748e93019b06fac2428685a58968f370dd3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736b69652f72756c652d666c6f772f63692e796d6c3f6272616e63683d6d6173746572)](https://github.com/skie/rule-flow/actions)

A CakePHP plugin that seamlessly transforms server-side validation rules into client-side JSON Logic validation, providing automatic form validation without requiring separate client-side validation code.

Features
--------

[](#features)

- **Automatic Rule Transformation**: Converts CakePHP validation rules to JSON Logic format
- **Real-time Validation**: Client-side validation with immediate feedback
- **Custom Rules Support**: Extend with custom PHP rules and JavaScript functions
- **Dynamic Forms**: Support for dynamically added form fields
- **Zero Configuration**: Works automatically with enhanced FormHelper
- **Cross-Platform Patterns**: Consistent regex validation between PHP and JavaScript

Quick Start
-----------

[](#quick-start)

### Installation

[](#installation)

```
composer require skie/rule-flow
```

### Basic Usage

[](#basic-usage)

**1. Load the plugin in your CakePHP application:**

```
// In config/bootstrap.php or Application.php
$this->addPlugin('RuleFlow');
```

**2. Use in your controller:**

```
// Load the component
public function initialize(): void
{
    parent::initialize();
    $this->loadComponent('RuleFlow.Rule');
}

// Configure validation rules for forms
public function add()
{
    $article = $this->Articles->newEmptyEntity();
    $this->Rule->configureFormRules($this->Articles);
    $this->set(compact('article'));
}
```

**3. Use enhanced FormHelper in your view:**

```
// In src/View/AppView.php
public function initialize(): void
{
    parent::initialize();
    $this->loadHelper('RuleFlow.Form');
}
```

**4. Create forms with automatic validation:**

```
