I want to add custom methods for customer
role. For ex:
cart()
addresses()
favorites()
…
Which one should I use?
User models or methods?
Also what the access differences? For ex:
userMethods : kirby()->user()->cart();
userModels : kirby()->user()->cart();
Right? Just a role difference? Little confused…
Thanks
For a particular role, use a model. The difference is that methods apply to all users whereas models are role specific. Also, with models you can override native methods, with methods you can’t.
All right, then there’s a problem with userModels
, I’ll create an issue on GitHub.
This has already been fixed on the dev branch, no need to create a new issue.
Describe the bug
I created a new User model like described in the docs (ok, ok, I added it there myself):
In /site/plugins/usermodels/index.php
<?php
class...
status: in progress 🔁
type: bug 🐛