Skip to content

Commit

Permalink
correction pour que les mails sur miltis s'envoi bien car commande ré…
Browse files Browse the repository at this point in the history
…alisée seulement après terminate symfony
  • Loading branch information
lchampel committed Apr 6, 2016
1 parent d0563e2 commit fb87b2a
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 fb87b2a

Please sign in to comment.