9. Form Help Messages

9.1. Help Messages

Help messages are short notes that are rendered together with form fields. They are generally used to show additional information so the user can complete the form element faster and more accurately.

9.2. Example

<?php
class ExampleAdmin.php
{
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->with('General')
                ->add('title', null, array('help'=>'Set the title of a web page'))
                ->add('keywords', null, array('help'=>'Set the keywords of a web page'))
            ->end();
    }
}

9.3. Alternative Way To Define Help Messages

<?php
class ExampleAdmin.php
{
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->with('General')
                ->add('title')
                ->add('keywords')
                ->setHelps(array(
                    'title' => 'Set the title of a web page',
                    'keywords' => 'Set the keywords of a web page',
                ))
            ->end();
    }
}

Table Of Contents

Previous topic

8. Form Types

Next topic

10. Field Types

This Page