Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Validate multi dimensional array#581

Open
evtaylor wants to merge 1 commit intokohana:3.4/developfrom
evtaylor:3.4/feature/validate-multi-dimensional-array
Open

Validate multi dimensional array#581
evtaylor wants to merge 1 commit intokohana:3.4/developfrom
evtaylor:3.4/feature/validate-multi-dimensional-array

Conversation

@evtaylor
Copy link
Copy Markdown

@evtaylor evtaylor commented Dec 5, 2014

See http://dev.kohanaframework.org/issues/4035

$array = array(
    'user' => array(
        'name' => 'Evan'
    )
);

$validation = Validation::factory($array)
    ->rule('user.name', 'not_empty'); 

By adding rules using existing dot notation
@rjd22
Copy link
Copy Markdown

rjd22 commented Dec 6, 2014

@evtaylor this needs tests for both the array path as the Validator using the array path.

@enov enov added the Needs Test label May 8, 2015
@arteymix
Copy link
Copy Markdown

arteymix commented Nov 7, 2015

If we go multidimensional, what about a * notation to specify all keys within an array?

->rule(`users.*.name`, `not_empty`)

@neo22s neo22s added this to the 4.0.0 milestone Mar 21, 2016
@neo22s
Copy link
Copy Markdown
Member

neo22s commented Mar 21, 2016

for 4.0.0 ?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants