Read data from form which is not mapped with entity
<p>I created form in controller. Form is not related with entity.</p>

<pre><code> public function formularzAction(Request $request) 
    $form = $this-&gt;createFormBuilder()
            -&gt;add('task', TextType::class, array('mapped' =&gt; false))
            -&gt;add('dueDate', DateType::class, array('mapped' =&gt; false))
            -&gt;add('save', SubmitType::class, array('label' =&gt; 'Create Post'))
            -&gt;getForm();
    $form-&gt;handleRequest($request);
    if ($form-&gt;isSubmitted()) {
        $t = $form-&gt;getData();
        return new Response(form['task']-&gt;getData());
    }
    return $this-&gt;render('JakubBundle:Default:formularz.html.twig', array(
                'form' =&gt; $form-&gt;createView()
    ));
}
</code></pre>

<p>I am trying to read form data.
$form['task']->getData() is working but $form['dueDate']->getData() not. Error message is "The Response content must be a string or object implementing __toString(), "object" given. "
How should I solve problem. Thanks for help in advance.</p>