Desenvolvemento en PHP con Symfony: Diferenzas entre revisións

De Wiki do Ciclo ASIR do IES de Rodeira
Saltar á navegación Saltar á procura
Sen resumo de edición
Sen resumo de edición
Liña 14: Liña 14:
composer require symfony/webpack-encore-bundle
composer require symfony/webpack-encore-bundle
yarn install
yarn install



After installing Encore, your app already has a few files, organized into an assets/ directory:
After installing Encore, your app already has a few files, organized into an assets/ directory:
Liña 28: Liña 29:
assets/controllers/hello_controller.js
assets/controllers/hello_controller.js



With Encore, think of your app.js file like a standalone JavaScript application: it will require all of the dependencies it needs (e.g. jQuery or React), including any CSS. Your app.js file is already doing this with a JavaScript import statement:

Construye el CSS y JS con webpack
yarn watch || yarn dev || yarn build


bin/console make:controller MainController
bin/console make:controller MainController

Revisión como estaba o 18 de outubro de 2022 ás 21:33

Esta guía se basa en Symfony 4.4[notas 1]

Instalación e Configuración

Requerimentos:

  • apt install php-symfony
  • apt install composer

Inicio da Aplicación

composer create-project symfony/website-skeleton:"^4.4" my_project_directory

Microservizos e APIs

composer create-project symfony/skeleton:"^4.4" my_project_directory

  • annotations

composer require sensio/framework-extra-bundle composer require symfony/webpack-encore-bundle yarn install


After installing Encore, your app already has a few files, organized into an assets/ directory:


assets/app.js

assets/bootstrap.js

assets/controllers.json

assets/styles/app.css

assets/controllers/hello_controller.js


With Encore, think of your app.js file like a standalone JavaScript application: it will require all of the dependencies it needs (e.g. jQuery or React), including any CSS. Your app.js file is already doing this with a JavaScript import statement:

Construye el CSS y JS con webpack yarn watch || yarn dev || yarn build

bin/console make:controller MainController

Notas

  1. Esta guía utilizará Symfony 4.4 porque a versión soportada na actual Debian Stable bullseye.