I'm working in a custom module for drupal 8. I have a form and I'm trying to send by means of a submit button some data from my custom module to another php script file:
$form['submit2'] = [
'#type' => 'submit',
'#value' => t('editor'),
'#access' =>isset($_GET['id']) ? true:false,
'#submit' => ['::goto_editor']
];
....
public function goto_editor() {
$session = \Drupal::request()->getSession();
$session->set('value', 'hi');
}
Now I want to get the value in another PHP file. How can I connect my PHP script with the Drupal 8.x session service? Thanks a lot.