[go: up one dir, main page]

0% found this document useful (0 votes)
675 views4 pages

Commandes Symfony

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 4

Cration dun bundle :

phpapp/console generate:bundle

Gnration d'un entity:


phpapp/console generate:doctrine:entity

Gnration des entits :


phpapp/console doctrine:generate:entitiesNomduBundle:Nom de l'entity

Cration de la base de donne :


phpapp/console doctrine:database:create

Cration des tables :


phpapp/console doctrine:schema:create

Mettre jour les tables :


phpapp/console doctrine:schema:update --force

Gnration ducontructeur de formulaire(FormType):


phpapp/console doctrine:generate:formNomduBundle:Nom de l'entity

Mettre jour les CSS, JS et images :


phpapp/console assets:install

Vider le cache :
phpapp/console cache:clear

Cration dun utilisateur pour FOSUserBundle :


phpapp/console fos:user:create

Rendre un utilisateur admin :

phpapp/console fos:user:promoteusername
ROLE_ADMIN

En cas de problme, pour vrifier les entits :


php app/console cache:warmup --env=prod --no-debug

CRUD

C:\wamp\www\app_symfony2.8>php app/console doctrine:generate:crud

Welcome to the Doctrine2 CRUD generator

This command helps you generate CRUD controllers and templates.

First, give the name of the existing entity for which you want to generate a CRU
D
(use the shortcut notation like AcmeBlogBundle:Post)

The Entity shortcut name: filmBundle:film

By default, the generator creates two actions: list and show.


You can also ask it to generate "write" actions: new, update, and delete.

Do you want to generate the "write" actions [no]? yes

Determine the format to use for the generated CRUD.

Configuration format (yml, xml, php, or annotation) [annotation]: yml

Determine the routes prefix (all the routes will be "mounted" under this
prefix: /prefix/, /prefix/new, ...).

Routes prefix [/film]:

Summary before generation

You are going to generate a CRUD controller for "filmBundle:film"


using the "yml" format.

Do you confirm generation [yes]?

CRUD generation

Generating the CRUD code: OK


Generating the Form code: OK
Updating the routing: Confirm automatic update of the Routing [yes]?
Importing the CRUD routes:

[ERROR] The bundle's "Resources/config/routing.yml" file cannot be imported


from "app/config/routing.yml" because the "filmBundle" bundle is
already imported. Make sure you are not using two different
configuration/routing formats in the same bundle because it won't work.
OK

Everything is OK! Now get to work :).

C:\wamp\www\app_symfony2.8>

You might also like