src/Kunstmaan/ArticleBundle/Twig/ArticleTwigExtension.php
public function getTags(Request $request, $className)
    {
        $context = array();

        $tagRepository = $this->em->getRepository($className);
        $context['tags'] = $tagRepository->findBy(array(), array('name' => 'ASC'));

        $searchTag = $request->get('tag') ? explode(',', $request->get('tag')) : null;
        if ($searchTag) {
            $context['activeTag'] = true;
            $context['activeTags'] = $searchTag;
        }

        return $context;
    }
public function getTags(Request $request, $className)
    {
        $context = array();

        $tagRepository = $this->em->getRepository($className);
        $context['tags'] = $tagRepository->findBy(array(), array('name' => 'ASC'));

        $searchTag = $request->get('tag') ? explode(',', $request->get('tag')) : null;
        if ($searchTag) {
            $context['activeTag'] = true;
            $context['activeTags'] = $searchTag;
        }

        return $context;
    }
public function getTags ( Request $ request , $ className ) { $ context = array ( ) ; $ tagRepository = $ this -> em -> getRepository ( $ className ) ; $ context [ 'tags' ] = $ tagRepository -> findBy ( array ( ) , array ( 'name' => 'ASC' ) ) ; $ searchTag = $ request -> get ( 'tag' ) ? explode ( ',' , $ request -> get ( 'tag' ) ) : null ; if ( $ searchTag ) { $ context [ 'activeTag' ] = true ; $ context [ 'activeTags' ] = $ searchTag ; } return $ context ; }
Get tags array for view.

@param Request $request
@param string  $className

@return array
Get tags array for view .