Added the UserDataSpan Twig extension

This Twig extension can filter User entities, creating a HTML <span>
element from them with the class userdata, which can later be converted
to an AJAX tooltip with jquery.cluetip

Signed-off-by: Gergely Polonkai <polesz@w00d5t0ck.info>
This commit is contained in:
Polonkai Gergely
2012-08-01 01:15:10 +02:00
parent fe41e755f7
commit ac6467f649
16 changed files with 85 additions and 14 deletions

View File

@@ -4,7 +4,9 @@ namespace KekRozsak\SecurityBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Security\Core\User\UserInterface;
@@ -121,4 +123,17 @@ class DefaultController extends Controller
return array(
);
}
/**
* @Route("/profil/{id}/ajax-felhasznalo-info.{_format}", name="KekRozsakSecurityBundle_ajaxUserdata", requirements={"_format": "html"})
* @Method({"GET"})
* @Template()
* @ParamConverter("user")
*/
public function ajaxUserdataAction(User $user)
{
return array(
'user' => $user,
);
}
}