38 lines
1.3 KiB
PHP
38 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers\Front;
|
|
|
|
use App\Models\UserModel;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
class UserController extends FrontController
|
|
{
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
parent::initController($request, $response, $logger);
|
|
$this->_className .= 'User';
|
|
$this->_model = new UserModel();
|
|
helper($this->_className);
|
|
$this->_viewPath .= strtolower($this->_className);
|
|
$this->_viewDatas['title'] = lang($this->_className . '.title');
|
|
$this->_viewDatas['className'] = $this->_className;
|
|
}
|
|
|
|
//Field별 Form Datas 처리용
|
|
protected function getFieldFormData(string $field, $entity = null): array
|
|
{
|
|
switch ($field) {
|
|
case 'passwd':
|
|
$this->_viewDatas['fieldDatas'][$field] = $this->request->getVar($field);
|
|
$this->_viewDatas['fieldDatas']['confirmpassword'] = $this->request->getVar('confirmpassword');
|
|
break;
|
|
default:
|
|
return parent::getFieldFormData($field, $entity);
|
|
break;
|
|
}
|
|
return $this->_viewDatas['fieldDatas'];
|
|
}
|
|
}
|