Created
December 29, 2011 02:27
-
-
Save Peksa/1531277 to your computer and use it in GitHub Desktop.
Play base controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@With(BaseController.class) | |
public class Application extends Controller | |
{ | |
// Normal controller actions here | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BaseController extends Controller | |
{ | |
@Before | |
static void setConnectedUser() | |
{ | |
if (Security.isConnected()) | |
{ | |
User connectedUser = User.findById(Security.getConnectedUser()); | |
renderArgs.put("connectedUser", connectedUser); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment