diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-08-15 17:02:39 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-08-15 17:02:39 +0400 |
commit | bb06bc66249b9e6ed6a6922386773c1c2d207173 (patch) | |
tree | 5784fdf18bbd0b5472cafe07807fcaae7453063c /plugins/SitesManager/Controller.php | |
parent | c9fcd01f768cffd0a2b3cfebfd9dc4f3f24b433f (diff) |
this is just to showcase the convenient method renderTemplate()
Diffstat (limited to 'plugins/SitesManager/Controller.php')
-rw-r--r-- | plugins/SitesManager/Controller.php | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/plugins/SitesManager/Controller.php b/plugins/SitesManager/Controller.php index 48afa6cbe6..b75ee8a036 100644 --- a/plugins/SitesManager/Controller.php +++ b/plugins/SitesManager/Controller.php @@ -26,11 +26,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin */ public function index() { - $view = new View('@SitesManager/index'); - - $this->setBasicVariablesView($view); - - return $view->render(); + return $this->renderTemplate('index'); } public function getGlobalSettings() { @@ -100,14 +96,13 @@ class Controller extends \Piwik\Plugin\ControllerAdmin $idSite = Common::getRequestVar('idSite'); Piwik::checkUserHasViewAccess($idSite); $jsTag = Piwik::getJavascriptCode($idSite, SettingsPiwik::getPiwikUrl()); - $view = new View('@SitesManager/displayJavascriptCode'); - $this->setBasicVariablesView($view); - $view->idSite = $idSite; - $site = new Site($idSite); - $view->displaySiteName = $site->getName(); - $view->jsTag = $jsTag; - - return $view->render(); + $site = new Site($idSite); + + return $this->renderTemplate('displayJavascriptCode', array( + 'idSite' => $idSite, + 'displaySiteName' => $site->getName(), + 'jsTag' => $jsTag + )); } /** |