Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Use PropertyPath from new PropertyAccess component #57

Merged
merged 1 commit into from May 13, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions Twig/PagerfantaExtension.php
Expand Up @@ -12,7 +12,8 @@
namespace WhiteOctober\PagerfantaBundle\Twig;

use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Form\Util\PropertyPath;
use Symfony\Component\PropertyAccess\PropertyPath;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Pagerfanta\PagerfantaInterface;

/**
Expand Down Expand Up @@ -82,7 +83,8 @@ public function renderPagerfanta(PagerfantaInterface $pagerfanta, $viewName = nu
$routeParams = $options['routeParams'];
$pagePropertyPath = new PropertyPath($options['pageParameter']);
$routeGenerator = function($page) use($router, $routeName, $routeParams, $pagePropertyPath) {
$pagePropertyPath->setValue($routeParams, $page);
$propertyAccessor = PropertyAccess::getPropertyAccessor();
$propertyAccessor->setValue($routeParams, $pagePropertyPath, $page);
return $router->generate($routeName, $routeParams);
};

Expand Down