Skip to content

[SOLVED] Registration using Modal #355

Answered by sammyskills
jlwegaba asked this question in Q&A
Discussion options

You must be logged in to vote
  1. Failed to know where to use the following use CodeIgniter\Shield\Entities\User

This should be in your controller, like so:

<?php

namespace App\Controllers\Admin;

use CodeIgniter\Shield\Entities\User;
// other codes...

Then in your addUser() method, after the validation, you can do something like this:

$user = new User();
$user->fill($this->request->getVar());
if ($usersModel->save($user) {
    // other codes...
}

You can read more about Entities here and about Fill here.

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@sammyskills
Comment options

@jlwegaba
Comment options

@jlwegaba
Comment options

@sammyskills
Comment options

@jlwegaba
Comment options

Answer selected by jlwegaba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants