Skip to content

Commit 0400427

Browse files
committed
Merge branch '6.3' into 6.4
* 6.3: Updating UX docs to install the new StimulusBundle Tweaks [HttpFoundation] update doc creation session table
2 parents 8bb1c1c + dea24f6 commit 0400427

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

frontend/encore/simple-example.rst

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ After :doc:`installing Encore </frontend/encore/installation>`, your app already
55
has a few files, organized into an ``assets/`` directory:
66

77
* ``assets/app.js``
8-
* ``assets/bootstrap.js``
9-
* ``assets/controllers.json``
108
* ``assets/styles/app.css``
11-
* ``assets/controllers/hello_controller.js``
129

1310
With Encore, think of your ``app.js`` file like a standalone JavaScript
1411
application: it will *require* all of the dependencies it needs (e.g. jQuery or React),
@@ -27,9 +24,6 @@ statements and create one final ``app.js`` (and ``app.css``) that contains *ever
2724
your app needs. Encore can do a lot more: minify files, pre-process Sass/LESS,
2825
support React, Vue.js, etc.
2926

30-
The other files - ``bootstrap.js``, ``controllers.json`` and ``hello_controller.js``
31-
relate to a topic you'll learn about soon: `Stimulus & Symfony UX`_.
32-
3327
Configuring Encore/Webpack
3428
--------------------------
3529

@@ -222,10 +216,18 @@ easy to attach behavior to HTML. It's powerful, and you will love it! Symfony
222216
even provides packages to add more features to Stimulus. These are called the
223217
Symfony UX Packages.
224218

225-
If you followed the setup instructions, you should already have Stimulus installed
226-
and ready to go! In fact, that's the purpose of the ``assets/bootstrap.js`` file:
227-
to initialize Stimulus and automatically load any "controllers" from the
228-
``assets/controllers/`` directory.
219+
To use Stimulus, first install StimulusBundle:
220+
221+
.. code-block:: terminal
222+
223+
$ composer require symfony/stimulus-bundle
224+
225+
The Flex recipe should add several files/directories:
226+
227+
* ``assets/bootstrap.js`` - initializes Stimulus;
228+
* ``assets/controllers/`` - a directory where you'll put your Stimulus controllers;
229+
* ``assets/controllers.json`` - file that helps load Stimulus controllers form UX
230+
packages that you'll install.
229231

230232
Let's look at a simple Stimulus example. In a Twig template, suppose you have:
231233

session.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,14 @@ Preparing the Database to Store Sessions
880880
........................................
881881

882882
Before storing sessions in the database, you must create the table that stores
883-
the information. The session handler provides a method called
883+
the information.
884+
885+
With Doctrine installed, the session table will be automatically generated when
886+
you run the ``make:migration`` command if the database targeted by doctrine is
887+
identical to the one used by this component.
888+
889+
Or if you prefer to create the table yourself and the table has not already been
890+
created, the session handler provides a method called
884891
:method:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\PdoSessionHandler::createTable`
885892
to set up this table for you according to the database engine used::
886893

@@ -890,7 +897,9 @@ to set up this table for you according to the database engine used::
890897
// the table could not be created for some reason
891898
}
892899

893-
If you prefer to set up the table yourself, it's recommended to generate an
900+
If the table already exists an exception will be thrown.
901+
902+
If you would rather set up the table yourself, it's recommended to generate an
894903
empty database migration with the following command:
895904

896905
.. code-block:: terminal
@@ -904,6 +913,10 @@ file and run the migration with the following command:
904913
905914
$ php bin/console doctrine:migrations:migrate
906915
916+
If needed, you can also add this table to your schema by calling
917+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\PdoSessionHandler::configureSchema`
918+
method in your code.
919+
907920
.. _mysql:
908921

909922
MariaDB/MySQL

0 commit comments

Comments
 (0)