Add getValue/setValue/hasValue and isValueEmpty to FormState

Created on 6 August 2014, about 10 years ago
Updated 8 June 2023, over 1 year ago

Problem/Motivation

FormState should provide methods to interact with $form_state['values'].

Proposed resolution

Add get/set/has methods.
Instead of just supporting a scalar key, this should also allow arrays to be passed in, to function like #parents does.


// D7
if (isset($form_state['values']['foo']['bar'])) {
}

// D8
if ($form_state->hasValue(array('foo', 'bar'))) {
}

Remaining tasks

User interface changes

API changes

πŸ“Œ Task
Status

Fixed

Version

8.0 ⚰️

Component
FormΒ  β†’

Last updated about 12 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024