Some Symfony 2 Command



# See the list of command:
  => php app/console list

# Create a new bundle for the application:
  => php app/console generate:bundle --namespace=Ens/JobeetBundle --format=yml

The generator will ask you some questions before generating the bundle. 
Here are the questions and the answers(all except one are the default answers):

  Bundle namespace [Ens/JobeetBundle]: Ens/JobeetBundle
  Bundle name [EnsJobeetBundle]: EnsJobeetBundle
  Target directory [/home/dragos/work/jobeet/src]: /home/dragos/work/jobeet/src
  Configuration format (yml, xml, php, or annotation) [yml]: yml
  Do you want to generate the whole directory structure [no]? yes
  Do you confirm generation [yes]? yes
  Confirm automatic update of your Kernel [yes]? yes
  Confirm automatic update of the Routing [yes]? yes

# Clear the cache after generating the new bundle with:
  => php app/console cache:clear --env=prod
  => php app/console cache:clear --env=dev

# Create the database using the information of app/config/parameters.ini file:
  => php app/console doctrine:database:create

# Generate the module class:
  => php app/console doctrine:generate:entities EnsJobeetBundle

# Create database table from the schema:
  => php app/console doctrine:schema:update --force
	
# Update the vendor libraries:
  => php bin/vendors install --reinstall
	
# Load the intial data for testing:
  => php app/console doctrine:fixtures:load
	
# Create a new controller (src/Ens/JobeetBundle/Controllers/JobController.php)
with actions for listing, creating, editing and deleting:
  => php app/console doctrine:generate:crud --entity=EnsJobeetBundle:Job 
                 --route-prefix=ens_job --with-write --format=yml
	
# Tell Symfony to make images, stylesheets and js available to the public:
  => php app/console assets:install web

Leave a comment