Symfony security: useful methods for the view

31/01/2008

Check if user is logged in:

$sf_user->isAuthenticated()

Check if user belongs to a specific group:

$sf_user->hasCredential('admin')
No Comments

Symfony: accessing the request

20/11/2007

The commonly used

$this->getRequestParameter('blah')

is a shortened version of

$this->getRequest()->getRequestParameter('blah')

All sorts of other goodies are available using $this->getRequest(), including for example:

$this->getRequest()->getPathInfo()
No Comments