Esempio n. 1
0
/**
 * Get CSRF token form field.
 *
 * @return string
 */
function csrfField()
{
    return '<input type="hidden" name="csrf_token" value="' . csrfToken() . '">';
}
Esempio n. 2
0
function createCompleteForm()
{
    return ['fields' => ['_token' => ['name' => '_token', 'type' => 'hidden', 'value' => csrfToken(), 'validation' => ['require', 'csrf'], 'errors' => []], 'id' => ['name' => 'id', 'type' => 'hidden', 'value' => null, 'validation' => ['require', 'integer'], 'errors' => []]], 'attributes' => ['method' => 'post', 'action' => '/index.php/orders/complete']];
}
Esempio n. 3
0
function createPayForm()
{
    return ['fields' => ['_token' => ['name' => '_token', 'type' => 'hidden', 'value' => csrfToken(), 'validation' => ['require', 'csrf'], 'errors' => []], 'pay' => ['name' => 'pay', 'type' => 'text', 'value' => null, 'validation' => ['require', ['regexp', '/^\\d+(\\.\\d{1,2})?$/'], ['min_value', 1], ['max_value', 100000]], 'errors' => []]], 'attributes' => ['method' => 'post', 'action' => '/index.php/pay']];
}
Esempio n. 4
0
function createForm()
{
    return ['fields' => ['_token' => ['name' => '_token', 'type' => 'hidden', 'value' => csrfToken(), 'validation' => ['require', 'csrf'], 'errors' => []], 'name' => ['label' => 'Имя', 'name' => 'name', 'type' => 'text', 'value' => null, 'validation' => ['require', ['min_length', 6], ['max_length', 20], 'name'], 'errors' => []], 'email' => ['label' => 'Email', 'name' => 'email', 'type' => 'email', 'value' => null, 'validation' => ['require', 'email'], 'errors' => []], 'password' => ['label' => 'Пароль', 'name' => 'password', 'type' => 'password', 'value' => null, 'validation' => ['require', ['min_length', 6]], 'errors' => []], 'password_repeat' => ['label' => 'Подтвердите пароль', 'name' => 'password_repeat', 'type' => 'password', 'value' => null, 'validation' => ['require', ['min_length', 6], ['equal', 'password']], 'errors' => []]], 'attributes' => ['method' => 'post']];
}
Esempio n. 5
0
function createCreateForm()
{
    return ['fields' => ['_token' => ['name' => '_token', 'type' => 'hidden', 'value' => csrfToken(), 'validation' => ['require', 'csrf'], 'errors' => []], 'email' => ['label' => 'Email', 'name' => 'email', 'type' => 'email', 'value' => null, 'validation' => ['require', 'email'], 'errors' => []], 'password' => ['label' => 'Пароль', 'name' => 'password', 'type' => 'password', 'value' => null, 'validation' => ['require', ['min_length', 6]], 'errors' => []]], 'attributes' => ['method' => 'post']];
}
Esempio n. 6
0
function createDestroyForm()
{
    return ['fields' => ['_token' => ['name' => '_token', 'type' => 'hidden', 'value' => csrfToken(), 'validation' => ['require', 'csrf'], 'errors' => []]], 'attributes' => ['method' => 'post', 'action' => '/index.php/logout']];
}