-
-
Notifications
You must be signed in to change notification settings - Fork 133
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 format() on null #526
Comments
Hi, try this
|
Also you can try a null-safe operator: echo Html::span($post->getPublishedAt()?->format('H:i d.m.Y')); But I suggest to find more convenient workaround and change the view's logic because you may get |
Both approaches above work well. |
Brilliant! Thank you for your contribution pcbal. I will try xepozz's suggestion on issue #462. Desperately looking for simplification of issue 462 into a simple 'save' instead of separate 'add' and 'edit' functions even though my solution works. |
What steps will reproduce the problem?
install demo create user admin add a post add tag click on tag link
What is the expected result?
tag link should lead to tag page
What do you get instead?
format() error on line getPublishedAt()
Additional info
The text was updated successfully, but these errors were encountered: