10000 Merge branch '3.4' into 4.1 · symfony/symfony-docs@f18cbc8 · GitHub
[go: up one dir, main page]

Skip to content

Commit f18cbc8

Browse files
committed
Merge branch '3.4' into 4.1
* 3.4: Update filesystem.rst Update form_dependencies.rst Fix encore advanced config watchOptions example [WebLink] Add an example using Priority Hints Update form.rst Use "number" instead of "numeric" Update Range.rst
2 parents 70eedcf + 6f04086 commit f18cbc8

File tree

6 files changed

+29
-5
lines changed

6 files changed

+29
-5
lines changed

components/filesystem.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,14 @@ isAbsolutePath
279279
// returns false
280280
$fileSystem->isAbsolutePath('../dir');
281281

282+
tempnam
283+
~~~~~~~
284+
285+
:method:`Symfony\\Component\\Filesystem\\Filesystem::tempnam` creates a temporary file with a unique filename, and returns its path, or throw an exception on failure::
286+
287+
// returns a path like : /tmp/prefix_wyjgtF
288+
$filesystem->tempnam('/tmp', 'prefix_');
289+
282290
dumpFile
283291
~~~~~~~~
284292

components/form.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ support for very important features:
5757
The Symfony Form component relies on other libraries to solve these problems.
5858
Most of the time you will use Twig and the Symfony
5959
:doc:`HttpFoundation </components/http_foundation>`,
60-
Translation and Validator components, but you can replace any of these with
61-
a different library of your choice.
60+
:doc:`Translation </components/translation>` and :doc:`Validator </components/validator>`
61+
components, but you can replace any of these with a different library of your choice.
6262

6363
The following sections explain how to plug these libraries into the form
6464
factory.

form/form_dependencies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ so that you can make a query. First, add this as an argument to your form class:
9595

9696
If you're using :ref:`autowire <services-autowire>` and
9797
:ref:`autoconfigure <services-autoconfigure>`, then you don't need to do *anything*
98-
else: Symfony will automatically know to pass the correct ``EntityManager`` object
98+
else: Symfony will automatically know how to pass the correct ``EntityManager`` object
9999
to your ``__construct()`` method.
100100

101101
If you are **not using autowire and autoconfigure**, register your form as a service

frontend/encore/advanced-config.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Encore generates the Webpack configuration that's used in your
88
For example, suppose you need to set `Webpack's watchOptions`_ setting. To do that,
99
modify the config after fetching it from Encore:
1010

11+
.. TODO update the following config example when https://github.com/symfony/webpack-encore/pull/486 is merged and configureWatchOptions() is introduced
12+
1113
.. code-block:: javascript
1214
1315
// webpack.config.js
@@ -18,7 +20,10 @@ modify the config after fetching it from Encore:
1820
1921
// fetch the config, then modify it!
2022
var config = Encore.getWebpackConfig();
23+
// if you run 'encore dev --watch'
2124
config.watchOptions = { poll: true, ignored: /node_modules/ };
25+
// if you run 'encore dev-server'
26+
config.devServer.watchOptions = { poll: true, ignored: /node_modules/ };
2227
2328
// other examples: add an alias or extension
2429
// config.resolve.alias.local = path.resolve(__dirname, './resources/src');

reference/constraints/Range.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,15 +320,15 @@ Options
320320
min
321321
~~~
322322

323-
**type**: ``int`` or ``string`` (date format)
323+
**type**: ``number`` or ``string`` (date format)
324324

325325
This required option is the "min" value. Validation will fail if the given
326326
value is **less** than this min value.
327327

328328
max
329329
~~~
330330

331-
**type**: ``int`` or ``string`` (date format)
331+
**type**: ``number`` or ``string`` (date format)
332332

333333
This required option is the "max" value. Validation will fail if the given
334334
value is **greater** than this max value.

web_link.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ If you reload the page, the perceived performance will improve because the
6666
server responded with both the HTML page and the CSS file when the browser only
6767
requested the HTML page.
6868

69+
Additionally, according to `the Priority Hints specification`_, you can signal
70+
the priority of the resource to download using the ``importance`` attribute:
71+
72+
.. code:: twig
73+
74+
<head>
75+
{# ... #}
76+
<link rel="stylesheet" href="{{ preload('/app.css', { importance: 'low' }) }}">
77+
</head>
78+
6979
.. tip::
7080

7181
Google Chrome provides an interface to debug HTTP/2 connections. Browse
@@ -163,6 +173,7 @@ You can also add links to the HTTP response directly from controllers and servic
163173
.. _`Resource Hints`: https://www.w3.org/TR/resource-hints/
164174
.. _`Docker installer and runtime for Symfony`: https://github.com/dunglas/symfony-docker
165175
.. _`preload`: https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content
176+
.. _`the Priority Hints specification`: https://wicg.github.io/priority-hints/
166177
.. _`the Preload specification`: https://www.w3.org/TR/preload/#server-push-(http/2)
167178
.. _`Cloudflare`: https://blog.cloudflare.com/announcing-support-for-http-2-server-push-2/
168179
.. _`Fastly`: https://docs.fastly.com/guides/performance-tuning/http2-server-push

0 commit comments

Comments
 (0)
0