Skip to content

Controller helper Form validate('groupname') error with rules group #1419

Description

@luistrigo

name: Bug report
about: Controller helper


Describe the bug
From Documentation:
Docs » Controllers and Routing » Controllers
Validating $_POST data

if (! $this->validate('signup'))

I get this error:
Argument 1 passed to CodeIgniter\Validation\Validation::setRules() must be of the type array, string given

Config\Validation
public $signup = [
'username' => 'required',
'password' => 'required',
'pass_confirm' => 'required|matches[password]',
'email' => 'required|valid_email'
];
public $signup_errors = [
'username' => [
'required' => 'You must choose a username.',
],
'email' => [
'valid_email' => 'Please check the Email field. It does not appear to be valid.'
]
];

CodeIgniter 4 version
CodeIgniter 4.0.0 alpha.2

Context

  • OS: [e.g. MAC OS 10.14]
  • Web server [e.g. Apache]
  • PHP version [e.g. 7.2.8]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions