I have a form with a value field and i would like to set the value to a markup field as shown below. The problem is that it retuns empty. Is there other alternatives.
public function buildForm(array $form, FormStateInterface $form_state) { $form['container']['#tree'] = TRUE; $form['container']['#type'] = 'container'; $form['container']['store_value'] = [ '#type' => 'value', '#value' => 'Angeline Mnene' ]; $form['container']['show_value'] = [ '#type' => 'markup', '#markup' => 'The stored value is: ' . $form_state- >getValue(['container','store_value']), ]; return $form; }