×
Inicio Aleatorio

symfony new project rest

Sección: Symfony

Creado: 22-12-24 (Actualizado: 13-07-18)


# NEW SYMFONY PROJECT
symfony new sf

# CREATE DATABASE
database parameters
sf doctrine:database:create

# IMPORT ENTITIES
sf doctrine:mapping:import --force AppBundle annotation

# GETTERS SETTERS
sf doctrine:generate:entities AppBundle

# ADD ENTITIES
sf doctrine:generate:entity --entity=AppBundle:Post --format=annotation --fields="name:string(255) description:text" [--no-interaction]

# UPDATE DATABASE
sf doctrine:schema:update --dump-sql
sf doctrine:schema:update --force

# GENERATE CRUD
sf generate:doctrine:crud --entity=AppBundle:Task --with-write --no-interaction

# EXTRA
#composer require friendsofsymfony/rest-bundle
#composer require jms/serializer-bundle
#composer require nelmio/cors-bundle
composer require voryx/restgeneratorbundle

AppKernel
        #new FOS\RestBundle\FOSRestBundle(),
        #new JMS\SerializerBundle\JMSSerializerBundle(),
        #new Nelmio\CorsBundle\NelmioCorsBundle(),
    new Voryx\RESTGeneratorBundle\VoryxRESTGeneratorBundle(),

# REST CRUD CONTROLLER
sf voryx:generate:rest --entity=AppBundle:Task

Siguiente Publicación