Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save factoryhr/bcfb0a694ed3a354b0b5496d869e8542 to your computer and use it in GitHub Desktop.
Save factoryhr/bcfb0a694ed3a354b0b5496d869e8542 to your computer and use it in GitHub Desktop.
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
// …
/*
* @Route(“/tag/show/{id}”, name=”show_tag”)
* @param Request $request
* @param $id
*/
public action showTag(
Request $request,
$id
)
{
$tag = \Pimcore\Model\Element\Tag::getById($id);
$taggedObjects = \Pimcore\Model\Element\Tag::getElementsForTag($tag, ‘object’);
$this->view->tag = $tag;
$this->view->taggedObjects = $taggedObjects;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment