Load Model MvcUser
marcelmastel opened this issue · 3 comments
marcelmastel commented
Hi, is possible load model user in a controller for manage email first name e last name in a view '/my-account/'?
cyberscribe commented
Yes, see documentation
On Wed, 6 Apr 2022 at 14:03, Marcello Mastellone ***@***.***> wrote:
Hi, is possible load model user in a controller for manage email first
name e last name in a view '/my-account/'?
—
Reply to this email directly, view it on GitHub
<#259>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFJLZLHL2O5TWKHVJ4DUMLVDWDSNANCNFSM5SV6ZRUA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Sent from Gmail Mobile
marcelmastel commented
I found this load_model.. but if I passed MvcUser.. Not works i have an issue
http://wpmvc.org/documentation/controllers/controller_methods/load_model.html
jose-tog commented
@marcelmastel try this instead.
$user_model = mvc_model('MvcUser'); $user = $user_model->find_by_id(1);
If you want to use the other way you need to do a mapping to a model in your Project say Member like in this link
https://wpmvc.org/documentation/wordpress_data_integration/models_for_wordpress_tables.html
Good luck!