you can set the default value with empty_data
$builder->add('myField', 'number', ['empty_data' => 'Default value'])
More Related Contents:
- do not include AcmeDemoBundle using symfony installer
- How to get the value from and save to Database in php
- Symfony 3, Guard & Handlers
- Creating sign-in with my site functionality
- Is there a built-in way to get all of the changed/updated fields in a Doctrine 2 entity
- How to access dynamic variable names in twig?
- Docker in MacOs is very slow
- Path of assets in CSS files in Symfony 2
- Symfony2 conceptual issue: general bundles vs. specific ones
- Symfony2 – Force file download
- Symfony 3.4 Use view inside my bundle
- Doctrine Query Language get Max/Latest Row Per Group
- Symfony: Clear doctrine cache
- Use Javascript to access a variable passed through Twig
- A YAML file cannot contain tabs as indentation
- Request headers bag is missing Authorization header in Symfony 2?
- How to access an application parameters from a service?
- Compile Error: Cannot use isset() on the result of an expression
- How to cache in Symfony 2?
- What is the best way to notify a user after an access_control rule redirects?
- Running Composer returns: “Could not open input file: composer.phar”
- How to disable redirection after login_check in Symfony 2
- Symfony 2 – how to pass data to formBuilder?
- “Class XXX is not a valid entity or mapped super class” after moving the class in the filesystem
- Accessing Files Relative to Bundle in Symfony2
- Why does PHP 7.4 on Windows aborts all command line actions that require user input?
- How to make form_rest() not display a field with Symfony2?
- Handling multiple file uploads in Sonata Admin Bundle
- How to render content from string/database with twig? [duplicate]
- How to access a different controller from inside a controller Symfony2