wp-mvc icon indicating copy to clipboard operation
wp-mvc copied to clipboard

Load Model MvcUser

Open marcelmastel opened this issue 3 years ago • 2 comments

Hi, is possible load model user in a controller for manage email first name e last name in a view '/my-account/'?

marcelmastel avatar Apr 06 '22 13:04 marcelmastel

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 https://github.com/tombenner/wp-mvc/issues/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

cyberscribe avatar Apr 06 '22 17:04 cyberscribe

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

marcelmastel avatar Apr 07 '22 23:04 marcelmastel

@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!

jose-tog avatar Jun 04 '24 20:06 jose-tog