Use Devel and kint , and search Kint NOTE: Please make sure devel profile must be kint ksm($form); // print the form with search option in kint 1 - $form_state->getValues(); // Shows all the form field value 2 - $form_state->getUserInput(); //to get the user input including buttons clicked +++++++++++++++++++++++ dump(_context|keys) }} // in twig file Compare string in Twig file {% set form_id = form.custom_data.form_id %} {% if form_id == "node_story_edit_form" %} Yes i am here {% endif %} 2 - get the # valued of form in twig templates, : All the array and object value can get by dot(.) operation while # value get by direct array like below, if($form['#form_id'] == 'node_video_form' || $form['#form_id'] == 'node_video_edit_form'){ $form['#custom_data'] = array('custom_form_id' => $form['#form_id']); ksm($form); } in twig file : {{ kint(form['...
Trying to Learn new things on drupal.