40 lines
909 B
PHP
40 lines
909 B
PHP
<?php
|
|
|
|
namespace App\Forms\Auth;
|
|
|
|
use App\Forms\CommonForm;
|
|
|
|
class GoogleForm extends CommonForm
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
public function action_init_process(string $action, array $formDatas = []): void
|
|
{
|
|
$fields = ['access_code'];
|
|
$filters = [];
|
|
switch ($action) {
|
|
case 'login':
|
|
case 'login_form':
|
|
break;
|
|
}
|
|
$this->setFormFields($fields);
|
|
$this->setFormRules($action, $fields);
|
|
$this->setFormFilters($filters);
|
|
$this->setFormOptions($action, $filters);
|
|
$this->setBatchjobFilters($filters);
|
|
}
|
|
public function getFormRule(string $action, string $field, array $formRules): array
|
|
{
|
|
switch ($field) {
|
|
case "access_code":
|
|
$formRules[$field] = "required|trim|string";
|
|
default:
|
|
$rule = parent::getFormRule($action, $field);
|
|
break;
|
|
}
|
|
return $formRules;
|
|
}
|
|
}
|