Use alias to get container parameters

This commit is contained in:
Jeremy Benoist 2016-01-21 12:24:27 +01:00
parent d6ba77e888
commit 67c99849ae
2 changed files with 5 additions and 5 deletions

View File

@ -133,10 +133,10 @@ class ConfigController extends Controller
$userManager->updateUser($newUser, true);
$config = new Config($newUser);
$config->setTheme($this->container->getParameter('wallabag_core.theme'));
$config->setItemsPerPage($this->container->getParameter('wallabag_core.items_on_page'));
$config->setRssLimit($this->container->getParameter('wallabag_core.rss_limit'));
$config->setLanguage($this->container->getParameter('wallabag_core.language'));
$config->setTheme($this->getParameter('wallabag_core.theme'));
$config->setItemsPerPage($this->getParameter('wallabag_core.items_on_page'));
$config->setRssLimit($this->getParameter('wallabag_core.rss_limit'));
$config->setLanguage($this->getParameter('wallabag_core.language'));
$em->persist($config);

View File

@ -84,7 +84,7 @@ class RssController extends Controller
$pagerAdapter = new DoctrineORMAdapter($qb->getQuery());
$entries = new Pagerfanta($pagerAdapter);
$perPage = $user->getConfig()->getRssLimit() ?: $this->container->getParameter('rss_limit');
$perPage = $user->getConfig()->getRssLimit() ?: $this->getParameter('wallabag_core.rss_limit');
$entries->setMaxPerPage($perPage);
return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array(