Hi,
i manage to extend the User plugin by adding new fields through this solution :
$model->hasOne['profile'] = ['MyCompany\Profile\Models\Profile'];
Everything works fine in the backend, the only thing i miss is the frontend component, i can't populate my form with the new fields, any idea ?
my account page :
title = "Account"
url = "/account/:code?"
layout = "default"
is_hidden = 0
[account]
redirect = "home"
paramCode = "code"
==
{% component 'account' %}
and view overridden (First name is a new field) :
{{ form_ajax('onUpdate', { model: user }) }}
<div class="form-group">
<label for="accountName">Full Name </label>
<input name="name" type="text" class="form-control" id="accountName" value="{{ form_value('name') }}">
</div>
<div class="form-group">
<label for="accountEmail">Email</label>
<input name="email" type="email" class="form-control" id="accountEmail" value="{{ form_value('email') }}">
</div>
<div class="form-group">
<label for="accountPassword">New Password</label>
<input name="password" type="password" class="form-control" id="accountPassword">
</div>
<div class="form-group">
<label for="accountPasswordConfirm">Confirm New Password</label>
<input name="password_confirmation" type="password" class="form-control" id="accountPasswordConfirm">
</div>
<div class="form-group">
<label for="firstName">First Name dsd</label>
<input name="first_name" type="text" class="form-control" id="firstName" value="{{ form_value('profile.first_name') }}">
</div>
<button type="submit" class="btn btn-default">Save</button>
{{ form_close() }}
Last updated