Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/divengine/ways
Browse files Browse the repository at this point in the history
  • Loading branch information
rafageist committed Dec 13, 2019
2 parents fc83147 + 4a1a569 commit 44e70d1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ ways::listen("/{section}/login", function(){
```
- `release`: version 2.4.0

Aug 23, 2019
Aug 24, 2019
-------------------
- `fix`: rules for default action Run
- `release`: version 2.3.4

Jul 23, 2019
-------------------
- `fix`: fix flow of the data before bootstrap and invoke
- `release`: version 2.3.3

Jul 23, 2019
-------------------
- `fix`: bug fix in rules
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Div PHP Ways 2.4.0
# 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.
Expand Down
13 changes: 10 additions & 3 deletions src/ways.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}

}


Expand Down

0 comments on commit 44e70d1

Please sign in to comment.