![]() |
Set username procedurally in SHIELD - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Set username procedurally in SHIELD (/showthread.php?tid=92275) |
Set username procedurally in SHIELD - Vespa - 01-04-2025 I'd like to add custom First name and Last name to the registration form and don't allow user to set his own username, I'd like to set this field procedurally... for example combining First Name and Last name. So, I have created a custom registration form ( see code below ) to remove username field and added First and Last name fields Code: <form class="form-transparent-grey" action="<?= url_to('register') ?>" method="post"> Added First and Last name validations rules in app\Config\Validation.php file Code: public $registration = [ Created a custom userModel in app\Models\UserModel.php Code: declare(strict_types=1); but I have no idea how to add procedurally username into the db...any suggestions? Thanks a lot RE: Set username procedurally in SHIELD - bloxter - 01-04-2025 You could try something like this: PHP Code: declare(strict_types=1); RE: Set username procedurally in SHIELD - 4usol - 01-04-2025 may by events? https://shield.codeigniter.com/references/events/ RE: Set username procedurally in SHIELD - Vespa - 01-05-2025 Thanks for hints guys, helped me a lot. |