Skip to content

Commit

Permalink
Merge pull request #34 from lchampel/master
Browse files Browse the repository at this point in the history
correction pour que les mails sur miltis s'envoi bien car commande ré…
  • Loading branch information
juliens committed Apr 6, 2016
2 parents d0563e2 + fb87b2a commit f1df3dd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sources/sf2/Generic/WordpressBundle/Services/ShortcodeRender.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ public function getName()
return "sf2_render";
}

public function process($params=array())
public function process($params = array())
{

if (isset($params['_route'])) {
$route = $this->router->getRouteCollection()->get($params['_route']);
if ($route!=null) {
if ($route != null) {
$params = array_merge($route->getDefaults(), $params);
}
}
Expand All @@ -34,10 +34,11 @@ public function process($params=array())

private function isControllerString($route)
{
return (count(explode(':', $route))>=3);
return (count(explode(':', $route)) >= 3);
}

protected function render($params = array()) {
protected function render($params = array())
{
if (!isset($params['_controller']) || !$this->isControllerString($params['_controller'])) {
throw new \Exception('Vous n\'avez pas précisé de controller valide');
}
Expand All @@ -49,6 +50,7 @@ protected function render($params = array()) {
$request = Request::createFromGlobals();
$request = $request->duplicate(null, null, $params);
$response = $kernel->handle($request);
$kernel->terminate($request, $response);
return $response->getContent();
}

Expand Down

0 comments on commit f1df3dd

Please sign in to comment.