Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorMatthieu Napoli <matthieu@mnapoli.fr>2015-03-04 06:53:28 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2015-03-04 06:55:11 +0300
commita76ae7cbfe2257d697afa7dbd347ca4ba1b8a1ed (patch)
treeb17024b27127c0922bac08ea8aabf1b53827c088 /core
parent2d6780bd2253128bb94143c45f0a243d3510fbe0 (diff)
Simplified widget controllers
Diffstat (limited to 'core')
-rw-r--r--core/Http/ControllerResolver.php9
-rw-r--r--core/Plugin/Widgets.php1
2 files changed, 6 insertions, 4 deletions
diff --git a/core/Http/ControllerResolver.php b/core/Http/ControllerResolver.php
index 253cd8cb9f..5f683a18c9 100644
--- a/core/Http/ControllerResolver.php
+++ b/core/Http/ControllerResolver.php
@@ -51,9 +51,10 @@ class ControllerResolver
}
// Widget action
+ /** @var Widgets|null $widget */
$widget = Widgets::factory($module, $action);
if ($widget) {
- return $this->createWidgetController($module, $action, $parameters);
+ return $this->createWidgetController($widget, $action, $parameters);
}
// Report action
@@ -92,10 +93,10 @@ class ControllerResolver
return array($controller, $action);
}
- private function createWidgetController($module, $action, array &$parameters)
+ private function createWidgetController(Widgets $widget, $action, array &$parameters)
{
- $parameters['widgetModule'] = $module;
- $parameters['widgetMethod'] = $action;
+ $parameters['widget'] = $widget;
+ $parameters['method'] = $action;
return array($this->abstractFactory->make('Piwik\Plugins\CoreHome\Controller'), 'renderWidget');
}
diff --git a/core/Plugin/Widgets.php b/core/Plugin/Widgets.php
index 3199e7a80b..36081fe2d2 100644
--- a/core/Plugin/Widgets.php
+++ b/core/Plugin/Widgets.php
@@ -125,6 +125,7 @@ class Widgets
/**
* @ignore
+ * @return Widgets|null
*/
public static function factory($module, $action)
{