Skip to content

Commit f6a23bc

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.5
2 parents bb9e60e + 3b90296 commit f6a23bc

File tree

10 files changed

+42
-31
lines changed

10 files changed

+42
-31
lines changed

.github/workflows/deploy-userguide-latest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
4949
# Create an artifact of the html output
5050
- name: Upload artifact
51-
uses: actions/upload-artifact@v3
51+
uses: actions/upload-artifact@v4
5252
with:
5353
name: HTML Documentation
5454
path: user_guide_src/build/html/

.github/workflows/reusable-coveralls.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
coverage: xdebug
2525

2626
- name: Download coverage files
27-
uses: actions/download-artifact@v3
27+
uses: actions/download-artifact@v4
2828
with:
2929
path: build/cov
3030

.github/workflows/reusable-phpunit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ jobs:
206206

207207
- name: Upload coverage results as artifact
208208
if: ${{ inputs.enable-artifact-upload }}
209-
uses: actions/upload-artifact@v3
209+
uses: actions/upload-artifact@v4
210210
with:
211211
name: ${{ env.ARTIFACT_NAME }}
212212
path: build/cov/coverage-${{ env.ARTIFACT_NAME }}.cov

.github/workflows/reusable-serviceless-phpunit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116

117117
- name: Upload coverage results as artifact
118118
if: ${{ inputs.enable-artifact-upload }}
119-
uses: actions/upload-artifact@v3
119+
uses: actions/upload-artifact@v4
120120
with:
121121
name: ${{ env.ARTIFACT_NAME }}
122122
path: build/cov/coverage-${{ env.ARTIFACT_NAME }}.cov

tests/system/View/ParserFilterTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,20 @@ public function testDefault(): void
111111
$parser = new Parser($this->config, $this->viewsDir, $this->loader);
112112

113113
$data = [
114-
'value1' => null,
115-
'value2' => 0,
116-
'value3' => 'test',
114+
'value1' => '',
115+
'value2' => null,
116+
'value3' => 0,
117+
'value4' => 'test',
117118
];
118119

119-
$template = '{ value1|default(foo) } { value2|default(bar) } { value3|default(baz) }';
120+
$template = '{ value1|default(foo) } { value2|default(bar) } { value3|default(baz) }'
121+
. ' { value4|default(boo) } { undef|default(far) }';
120122

121123
$parser->setData($data);
122-
$this->assertSame('foo bar test', $parser->renderString($template));
124+
$this->assertSame(
125+
'foo bar baz test { undef|default(far) }',
126+
$parser->renderString($template)
127+
);
123128
}
124129

125130
public function testEsc(): void

user_guide_src/source/incoming/controllers.rst

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -321,16 +321,17 @@ Defining a Default Controller
321321

322322
Let's try it with the ``Helloworld`` controller.
323323

324-
To specify a default controller open your **app/Config/Routes.php**
325-
file and set this variable:
324+
To specify a default controller open your **app/Config/Routing.php**
325+
file and set this property::
326326

327-
.. literalinclude:: controllers/015.php
327+
public string $defaultController = 'Helloworld';
328328

329329
Where ``Helloworld`` is the name of the controller class you want to be used.
330330

331-
A few lines further down **Routes.php** in the "Route Definitions" section, comment out the line:
331+
And comment out the line in **app/Config/Routes.php**:
332332

333333
.. literalinclude:: controllers/016.php
334+
:lines: 2-
334335

335336
If you now browse to your site without specifying any URI segments you'll
336337
see the "Hello World" message.
@@ -340,8 +341,8 @@ see the "Hello World" message.
340341
precedence over Auto Routing, and controllers defined in the defined routes
341342
are denied access by Auto Routing (Improved) for security reasons.
342343

343-
For more information, please refer to the :ref:`routes-configuration-options` section of the
344-
:ref:`URI Routing <routing-auto-routing-improved-configuration-options>` documentation.
344+
For more information, please refer to the
345+
:ref:`routing-auto-routing-improved-configuration-options` documentation.
345346

346347
.. _controller-default-method-fallback:
347348

@@ -427,7 +428,7 @@ To call the above controller your URI will look something like this::
427428
Each of your sub-directories may contain a default controller which will be
428429
called if the URL contains *only* the sub-directory. Simply put a controller
429430
in there that matches the name of your default controller as specified in
430-
your **app/Config/Routes.php** file.
431+
your **app/Config/Routing.php** file.
431432

432433
CodeIgniter also permits you to map your URIs using its :ref:`Defined Route Routing <defined-route-routing>`..
433434

@@ -590,24 +591,25 @@ Defining a Default Controller (Legacy)
590591

591592
Let's try it with the ``Helloworld`` controller.
592593

593-
To specify a default controller open your **app/Config/Routes.php**
594-
file and set this variable:
594+
To specify a default controller open your **app/Config/Routing.php**
595+
file and set this property::
595596

596-
.. literalinclude:: controllers/015.php
597+
public string $defaultController = 'Helloworld';
597598

598599
Where ``Helloworld`` is the name of the controller class you want to be used.
599600

600-
A few lines further down **Routes.php** in the "Route Definitions" section, comment out the line:
601+
And comment out the line in **app/Config/Routes.php**:
601602

602603
.. literalinclude:: controllers/016.php
604+
:lines: 2-
603605

604606
If you now browse to your site without specifying any URI segments you'll
605607
see the "Hello World" message.
606608

607609
.. note:: The line ``$routes->get('/', 'Home::index');`` is an optimization that you will want to use in a "real-world" app. But for demonstration purposes we don't want to use that feature. ``$routes->get()`` is explained in :doc:`URI Routing <routing>`
608610

609-
For more information, please refer to the :ref:`routes-configuration-options` section of the
610-
:ref:`URI Routing <routing-auto-routing-legacy-configuration-options>` documentation.
611+
For more information, please refer to the the
612+
:ref:`routing-auto-routing-legacy-configuration-options` documentation.
611613

612614
Organizing Your Controllers into Sub-directories (Legacy)
613615
=========================================================
@@ -637,7 +639,7 @@ To call the above controller your URI will look something like this::
637639
Each of your sub-directories may contain a default controller which will be
638640
called if the URL contains *only* the sub-directory. Simply put a controller
639641
in there that matches the name of your default controller as specified in
640-
your **app/Config/Routes.php** file.
642+
your **app/Config/Routing.php** file.
641643

642644
CodeIgniter also permits you to map your URIs using its :ref:`Defined Route Routing <defined-route-routing>`..
643645

user_guide_src/source/incoming/controllers/015.php

Lines changed: 0 additions & 3 deletions
This file was deleted.

user_guide_src/source/installation/repositories.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ There are several development repositories, of interest to potential contributor
3232
+------------------+--------------+-----------------------------------------------------------------+
3333
| cache_ | developers | PSR-6 and PSR-16 Cache Adapters for CodeIgniter 4 |
3434
+------------------+--------------+-----------------------------------------------------------------+
35+
| queue_ | developers | Job Queue for CodeIgniter 4 |
36+
+------------------+--------------+-----------------------------------------------------------------+
3537

3638
.. _CodeIgniter4: https://github.com/codeigniter4/CodeIgniter4
3739
.. _translations: https://github.com/codeigniter4/translations
@@ -41,6 +43,7 @@ There are several development repositories, of interest to potential contributor
4143
.. _shield: https://codeigniter4.github.io/shield
4244
.. _tasks: https://github.com/codeigniter4/tasks
4345
.. _cache: https://github.com/codeigniter4/cache
46+
.. _queue: https://github.com/codeigniter4/queue
4447

4548
There are also several deployment repositories, referenced in the installation directions.
4649
The deployment repositories are built automatically when a new version is released, and they

user_guide_src/source/libraries/validation.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -788,9 +788,12 @@ a boolean true or false value signifying true if it passed the test or false if
788788

789789
.. literalinclude:: validation/034.php
790790

791-
By default, the system will look within **system/Language/en/Validation.php** for the language strings used
792-
within errors. In custom rules, you may provide error messages by accepting a ``&$error`` variable by reference in the
793-
second parameter:
791+
By default, the system will look within **system/Language/en/Validation.php** for the language strings used within
792+
errors. To provide default error messages for your custom rules, you may place them in **app/Language/en/Validation.php**
793+
(and/or corresponding folder of locale you use in place of ``en``). Also, in case you want to use some other language
794+
string file in place of the default **Validation.php**, you may provide error messages by accepting an ``&$error``
795+
variable by reference in the second (or, in case your rule needs to work with parameters, as described below – the
796+
fourth) parameter:
794797

795798
.. literalinclude:: validation/035.php
796799

user_guide_src/source/outgoing/view_parser.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,7 @@ date format (Y-m-d) A PHP **date**-compatible formatting string.
371371
date_modify value to add A **strtotime** compatible string to modify the date, { v|date_modify(+1 day) }
372372
/ subtract like ``+5 day`` or ``-1 week``.
373373

374-
default default value Displays the default value if the variable is empty or { v|default(just in case) }
375-
undefined.
374+
default default value Displays the default value if the variable is `empty()`_. { v|default(just in case) }
376375

377376
esc html, attr, Specifies the context to escape the data. { v|esc(attr) }
378377
css, js
@@ -419,6 +418,8 @@ title Displays a "title case" version of the string
419418
upper Displays the string in all uppercase. { v|upper }
420419
================ ================= =========================================================== ======================================
421420

421+
.. _empty(): https://www.php.net/manual/en/function.empty.php
422+
422423
See `PHP's NumberFormatter <https://www.php.net/manual/en/numberformatter.create.php>`_ for details relevant to the
423424
"local_number" filter.
424425

0 commit comments

Comments
 (0)