tombenner/wp-mvc

Load Model MvcUser

marcelmastel opened this issue · 3 comments

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

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