I get a POST data by this code.
$form->handleRequest($request);
if ($form->isValid()) {
Then I want to get a data.
$form->get('send')->isChecked();
If there is a 'send' submit button, it works well,however there is not it show this error.
Child "send" does not exist.
Then I have struggled to see if 'send' data is included $form or not.
like this
if ($form->get('send') !== null){
However it shows the same error.
How can I tell there is 'send' submit button in $form ??
There is 'send' button or 'draft' button depending on the situation.
I would like to tell which button is exist.
if ($form->get('send')->isChecked()){
}
else if( $form->get('draft')->isChecked()){
}
but ,this code shows the error when access the button which is not exist.