1. Configure parameters.yml database information
Execute common database commands:
php bin/console doctrine:database:create
At this point, there are more databases named test in the database;
Manually create database information
Create an Entity folder under the path APP_PATH /src/AppBundle Create a model Member.php
Set database encoding config.yml
View verification
$ php bin/console doctrine:schema:update --force |
Generate Getters and Setters
$ php bin/console doctrine:generate:entities AppBundle/Entity/Member |
Add a reference to the controller: AppBundle\Controller;
$ use AppBundle\Entity\Member; // Create model class // Set properties // get management class return new Response('Save new Member with id '.$member->getId()); |
Execute the test database to complete the data addition ok!