-
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
Aug 24, 2019
1 parent
e15cf6c
commit 4a1a569
Showing
4 changed files
with
21 additions
and
8 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.3.4 | ||
* | ||
* @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.3.4'; | ||
|
||
private static $__way_var; | ||
|
||
|
@@ -1091,9 +1091,12 @@ public static function call($controller, $data = [], $args = [], &$output = '', | |
$method = "{$controller}@{$action}"; | ||
if (isset($rules[$method])) { | ||
$rules = $rules[$method]; | ||
if (is_string($rules)) { | ||
$rules = [$rules]; | ||
} | ||
} elseif (isset($rules[$action])) { | ||
$rules = $rules[$action]; | ||
} | ||
|
||
if (is_string($rules)) { | ||
$rules = [$rules]; | ||
} | ||
|
||
foreach ($rules as $rule) { | ||
|
@@ -1469,9 +1472,13 @@ public static function register($path, $properties = []) | |
if (!is_array($rules)) { | ||
$rules = [$rules]; | ||
} | ||
|
||
foreach ($rules as $rule) { | ||
if (!is_array(self::$__controllers[$prop[self::PROPERTY_ID]]['prop'][self::PROPERTY_RULES])) | ||
self::$__controllers[$prop[self::PROPERTY_ID]]['prop'][self::PROPERTY_RULES] = []; | ||
self::$__controllers[$prop[self::PROPERTY_ID]]['prop'][self::PROPERTY_RULES]['Run'][] = $rule; | ||
} | ||
|
||
} | ||
|
||
|
||
|