public function showTagAction(Request $request, Tag $tag = null)
    {
        $this->denyAccessUnlessGranted('ez:tags:read');

        $data = [];

        if (!$tag instanceof Tag || !$tag->isSynonym()) {
            $configResolver = $this->getConfigResolver();

            $currentPage = (int) $request->query->get('page');
            $pager = $this->createPager(
                $this->tagChildrenAdapter,
                $currentPage,
                $configResolver->getParameter('admin.children_limit', 'eztags'),
                $tag
            );

            $data += [
                'childrenTags' => $pager,
            ];
        }

        if (!$tag instanceof Tag) {
            return $this->render(
                '@NetgenTags/admin/tag/dashboard.html.twig',
                $data
            );
        }

        $data += [
            'tag' => $tag,
            'latestContent' => $this->tagsService->getRelatedContent($tag, 0, 10),
        ];

        if (!$tag->isSynonym()) {
            $data += [
                'synonyms' => $this->tagsService->loadTagSynonyms($tag),
                'subTreeLimitations' => $this->getSubtreeLimitations($tag),
            ];
        }

        return $this->render(
            '@NetgenTags/admin/tag/show.html.twig',
            $data
        );
    }
public function showTagAction(Request $request, Tag $tag = null)
    {
        $this->denyAccessUnlessGranted('ez:tags:read');

        $data = [];

        if (!$tag instanceof Tag || !$tag->isSynonym()) {
            $configResolver = $this->getConfigResolver();

            $currentPage = (int) $request->query->get('page');
            $pager = $this->createPager(
                $this->tagChildrenAdapter,
                $currentPage,
                $configResolver->getParameter('admin.children_limit', 'eztags'),
                $tag
            );

            $data += [
                'childrenTags' => $pager,
            ];
        }

        if (!$tag instanceof Tag) {
            return $this->render(
                '@NetgenTags/admin/tag/dashboard.html.twig',
                $data
            );
        }

        $data += [
            'tag' => $tag,
            'latestContent' => $this->tagsService->getRelatedContent($tag, 0, 10),
        ];

        if (!$tag->isSynonym()) {
            $data += [
                'synonyms' => $this->tagsService->loadTagSynonyms($tag),
                'subTreeLimitations' => $this->getSubtreeLimitations($tag),
            ];
        }

        return $this->render(
            '@NetgenTags/admin/tag/show.html.twig',
            $data
        );
    }
public function showTagAction ( Request $ request , Tag $ tag = null ) { $ this -> denyAccessUnlessGranted ( 'ez:tags:read' ) ; $ data = [ ] ; if ( ! $ tag instanceof Tag || ! $ tag -> isSynonym ( ) ) { $ configResolver = $ this -> getConfigResolver ( ) ; $ currentPage = ( int ) $ request -> query -> get ( 'page' ) ; $ pager = $ this -> createPager ( $ this -> tagChildrenAdapter , $ currentPage , $ configResolver -> getParameter ( 'admin.children_limit' , 'eztags' ) , $ tag ) ; $ data += [ 'childrenTags' => $ pager , ] ; } if ( ! $ tag instanceof Tag ) { return $ this -> render ( '@NetgenTags/admin/tag/dashboard.html.twig' , $ data ) ; } $ data += [ 'tag' => $ tag , 'latestContent' => $ this -> tagsService -> getRelatedContent ( $ tag , 0 , 10 ) , ] ; if ( ! $ tag -> isSynonym ( ) ) { $ data += [ 'synonyms' => $ this -> tagsService -> loadTagSynonyms ( $ tag ) , 'subTreeLimitations' => $ this -> getSubtreeLimitations ( $ tag ) , ] ; } return $ this -> render ( '@NetgenTags/admin/tag/show.html.twig' , $ data ) ; }
Rendering a view which shows tag or synonym details.

@param \Symfony\Component\HttpFoundation\Request $request
@param \Netgen\TagsBundle\API\Repository\Values\Tags\Tag $tag

@return \Symfony\Component\HttpFoundation\Response
Rendering a view which shows tag or synonym details .