Using the background generator provided by the symfony framework is a great boon for writing back-ends. It reduces a lot of work and enables attention to logical design. The main process is as follows:
- Create a background program/Management Module
- Create a configuration file for generating background programs
- Add login module
* Create a background program/Management Module
> Symfony init-app backend
> Symfony propel-init-Admin backend post
> Symfony propel-init-Admin backend Comment comment
Note: The generation management module is different from the creation of general modules. The general module init-module, and the Management Module propel-init-Admin.
In fact, this is similar to the creation of scaffolding:
Symfony propel-generate-Crud frontend post
Symfony propel-generate-Crud frontend Comment comment
* Create a configuration file for generating background programs
Configuration File Location:/apps/backend/modules/modulename/config/generator. yml
For detailed configuration information, see Chapter 14 of symfony's authoritative guide.
* Added the login module.
> Symfony init-module backend Security
Edit apps/backend/modules/post/config/security. yml
ALL:
-Is_secure: On
Add the login form to the apps/backend/modules/security/templates/indexsuccess. php file.
Add the login Method to the apps/backend/modules/security/actions. Class. php file.
In the apps/backend/config/settings. yml file, set the login module:
ALL:
. Actions:
Login_module: Security
Login_action: Index
That is all!