Skip to content

Commit

Permalink
Merge pull request #28 from SahAssar/namespace-twig
Browse files Browse the repository at this point in the history
Add twig namespacing
  • Loading branch information
bobdenotter authored Feb 22, 2017
2 parents 36563fb + 3d6906a commit 420b65d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Action/StatisticsAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ public function displayStatistics(Request $request)
'webpath' => $this->webPath,
];

return $this->view->render("base.twig", $data);
return $this->view->render("@GoogleAnalytics/base.twig", $data);
}
}
6 changes: 4 additions & 2 deletions src/GoogleAnalyticsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,16 @@ public function widget()
];

// Render the template, and return the results
return $this->renderTemplate('widget.twig', $twigvars);
return $this->renderTemplate('@GoogleAnalytics/widget.twig', $twigvars);
}

/**
* @return array
*/
protected function registerTwigPaths()
{
return ['templates'];
return [
'templates' => ['namespace' => 'GoogleAnalytics']
];
}
}
4 changes: 2 additions & 2 deletions src/Snippet/AnalyticsSnippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ public function insertAnalytics()
//Check to see if universal is set
if ($this->config->isUniversal()) {
$data['domainname'] = $this->config->getUniversalDomainname();
return $this->view->render("universal.twig", $data);
return $this->view->render("@GoogleAnalytics/universal.twig", $data);
}

//Get full url for the current website
$data['domainname'] = $this->request->getCurrentRequest()->server->get('HTTP_HOST');

return $this->view->render("normal.twig", $data);
return $this->view->render("@GoogleAnalytics/normal.twig", $data);
}
}

0 comments on commit 420b65d

Please sign in to comment.