Skip to content

[2.1] added a Controller:getUser() shortcut to recover the current user #1990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 28, 2011
Merged

[2.1] added a Controller:getUser() shortcut to recover the current user #1990

merged 2 commits into from
Sep 28, 2011

Conversation

aerialls
Copy link
Contributor

No description provided.

public function getUser()
{
if (!$this->container->has('security.context')) {
throw new \LogicException('The SecurityBundle is not installed in your application.');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to be pedantic, but i would like to suggest to use the term "registered" instead of "installed", as it is the common sf2 terminology.

@fabpot Btw, long time ago there was a discussion about more pedagogy in error messages in the dev group: https://groups.google.com/group/symfony-devs/browse_thread/thread/f8045eab3a780e25/9c1af84f3d9ffac2
Has this been established finally?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaiwa: we try to improve error messages on case by case basis.

fabpot added a commit that referenced this pull request Sep 28, 2011
Commits
-------

f7bf7b5 fixed condition
181332b added a Controller:getUser() shortcut to recover the current user

Discussion
----------

[2.1] added a Controller:getUser() shortcut to recover the current user
@fabpot fabpot merged commit f7bf7b5 into symfony:master Sep 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants