Observer pattern in Symfony forms
The purpose of this project is to demonstrate the use of the form events. Read a [detailed description] in my blog.
This application allows you to manage locations. LocationController is used to:
For simplicity, there is a bare minimum of information in each entity:
- Location contains only a city,
- City contains its name and a reference to the region in which it is located,
- Region has a name and belongs to a country,
- Country is described by its name.
The key element of application is LocationType form type that is used for both creating and editing a location. This form provides the following fields:
countryis a list of all countries
regionis a list of all regions of the selected country. If the country is not selected this list should be empty.
city- a list of all cities of the selected region. If the region is not selected this list should be empty.
composer install bin/console doctrine:database:create bin/console doctrine:schema:update --force bin/console doctrine:fixtures:load -n
Run in docker
cd docker docker-compose up -d