src/PHPDish/Bundle/ForumBundle/Controller/ThreadController.php
public function indexAction(Request $request)
    {
        $criteria =  Criteria::create()->where(Criteria::expr()->eq('enabled', true))
            ->orderBy([
                'followerCount' => 'desc',
                'createdAt' => 'desc',
            ]);
        if ($request->query->get('tab') === 'following') {
            $threads = $this->getThreadManager()->findUserFollowingThreads(
                $this->getUser(),
                $request->query->getInt('page', 1),
                null,
                $criteria
            );
        } else {
            $threads = $this->getThreadManager()->findThreadsPager($criteria,
                $request->query->getInt('page', 1)
            );
        }

        $translator = $this->get('translator');
        $seoPage = $this->get('sonata.seo.page');
        $seoPage
            ->setTitle($translator->trans('thread.explore'))
            ->removeMeta('name', 'keywords')
            ->addMeta('name', 'description', $translator->trans('thread.explore'))
            ->addMeta('property', 'og:title', $translator->trans('thread.explore'))
            ->addMeta('property', 'og:url',  $this->generateUrl('threads', [],UrlGeneratorInterface::ABSOLUTE_URL))
            ->addMeta('property', 'og:description', $translator->trans('thread.explore'));

        return $this->render($this->configuration->getTemplate('Thread:index.html.twig'), [
            'threads' => $threads
        ]);
    }
public function indexAction(Request $request)
    {
        $criteria =  Criteria::create()->where(Criteria::expr()->eq('enabled', true))
            ->orderBy([
                'followerCount' => 'desc',
                'createdAt' => 'desc',
            ]);
        if ($request->query->get('tab') === 'following') {
            $threads = $this->getThreadManager()->findUserFollowingThreads(
                $this->getUser(),
                $request->query->getInt('page', 1),
                null,
                $criteria
            );
        } else {
            $threads = $this->getThreadManager()->findThreadsPager($criteria,
                $request->query->getInt('page', 1)
            );
        }

        $translator = $this->get('translator');
        $seoPage = $this->get('sonata.seo.page');
        $seoPage
            ->setTitle($translator->trans('thread.explore'))
            ->removeMeta('name', 'keywords')
            ->addMeta('name', 'description', $translator->trans('thread.explore'))
            ->addMeta('property', 'og:title', $translator->trans('thread.explore'))
            ->addMeta('property', 'og:url',  $this->generateUrl('threads', [],UrlGeneratorInterface::ABSOLUTE_URL))
            ->addMeta('property', 'og:description', $translator->trans('thread.explore'));

        return $this->render($this->configuration->getTemplate('Thread:index.html.twig'), [
            'threads' => $threads
        ]);
    }
threads 探索

@Route("/threads", name="threads")
@param Request $request
@return Response