-
Notifications
You must be signed in to change notification settings - Fork 39
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
Call to a member function avatar() on null #12
Comments
This is when $this->user is not defined, e.g. if no user is logged in. You need to make sure you always pass a User object there, otherwise you will get an error. You can use this workaround, if you cant ensure you always have a logged in user:
|
Got it working as follows:
anywhere you want to put upload box. For example in my case I've added above line in update.htm partial (overridden) of user component. After this add following code to account page code section:
Here modelClass is the class in which to relate picture (avatar) and modelKeyColumn is the column name to which this pic to relate. |
@bkrajendra |
I'm getting error:
I'm using following code in my component :
Ive also tried in Page Init method but its showing same error.
The text was updated successfully, but these errors were encountered: