I want to display different messages to a page built by Symfony depending on the situation. I initially set it up by creating a hidden field and setting the label to whatever message I want:
$builder->add('pageTopMsg', 'hidden', array(
'label' => $this->getPageTopMsg(),
'required' => false,
))
That works, but it doesn't feel right. Plus Symfony says I have to create getters and setters in an entity. The messages and the hidden field don't have any relationship with an entity. Is there a better way to display messages on a form dynamically.