-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rafageist
committed
Dec 13, 2019
1 parent
e15cf6c
commit fc83147
Showing
4 changed files
with
25 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
* | ||
* @package divengine/ways | ||
* @author Rafa Rodriguez [@rafageist] <[email protected]> | ||
* @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); | ||
} | ||
|
||
/** | ||
|