diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bdac8d..b347235 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +Dec 12, 2019 +------------------- +- `new`: passing data and args to rules + +```php + ['is-admin-section']]); + +``` +- `release`: version 2.4.0 + Aug 23, 2019 ------------------- - `fix`: fix flow of the data before bootstrap and invoke diff --git a/README.md b/README.md index 8c3d6c5..ce266e5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Div PHP Ways 2.3.3 +# Div PHP Ways 2.4.0 A "way" is different to a "route". We need a path for found a specific resource, but we need a way for do something. diff --git a/composer.json b/composer.json index 05b4aed..ebc33a7 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "controllers" ], "homepage": "https://divengine.com/ways", - "version": "2.3.3", + "version": "2.4.0", "require": { "php": ">=5.4.0", "ext-json": "*" diff --git a/src/ways.php b/src/ways.php index 8bbfba7..47b0946 100644 --- a/src/ways.php +++ b/src/ways.php @@ -21,7 +21,7 @@ * * @package divengine/ways * @author Rafa Rodriguez [@rafageist] - * @version 2.3.3 + * @version 2.4.0 * * @link https://divengine.com * @link https://divengine.com/ways @@ -57,7 +57,7 @@ class ways const PROPERTY_RULES = 'rules'; - private static $__version = '2.3.3'; + private static $__version = '2.4.0'; private static $__way_var; @@ -1099,7 +1099,7 @@ public static function call($controller, $data = [], $args = [], &$output = '', foreach ($rules as $rule) { $check = true; if (is_string($rule) && array_key_exists($rule, self::$__rules)) { - $check = self::checkRule($rule); + $check = self::checkRule($rule, $data, $args); } elseif (is_callable($rule)) { $check = $rule(); } @@ -1734,11 +1734,11 @@ public static function rule($ruleName, $rule) * * @return bool */ - public static function checkRule($ruleName) + public static function checkRule($ruleName, $data, $args) { $rule = self::$__rules[$ruleName]; - return (bool)$rule(); + return (bool) $rule($data, $args); } /**