mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Merge remote-tracking branch 'upstream/develop' into 4.4
This commit is contained in:
commit
10d3be685a
@ -125,7 +125,7 @@ class App extends BaseConfig
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* URI PROTOCOL
|
||||
* Force Global Secure Requests
|
||||
* --------------------------------------------------------------------------
|
||||
*
|
||||
* If true, this will force every request made to this application to be
|
||||
|
@ -266,8 +266,11 @@ Miscellaneous Functions
|
||||
|
||||
Checks to see if the page is currently being accessed via HTTPS. If it is, then
|
||||
nothing happens. If it is not, then the user is redirected back to the current URI
|
||||
but through HTTPS. Will set the HTTP Strict Transport Security header, which instructs
|
||||
modern browsers to automatically modify any HTTP requests to HTTPS requests for the $duration.
|
||||
but through HTTPS. Will set the HTTP Strict Transport Security (HTST) header, which instructs
|
||||
modern browsers to automatically modify any HTTP requests to HTTPS requests for the ``$duration``.
|
||||
|
||||
.. note:: This function is also used when you set
|
||||
``Config\App:$forceGlobalSecureRequests`` to true.
|
||||
|
||||
.. php:function:: function_usable($function_name)
|
||||
|
||||
|
@ -15,7 +15,7 @@ the application configuration files in the **app/Config** folder.
|
||||
:local:
|
||||
:depth: 2
|
||||
|
||||
Working With Configuration Files
|
||||
Working with Configuration Files
|
||||
********************************
|
||||
|
||||
You can access configuration files for your classes in several different ways.
|
||||
|
@ -109,11 +109,11 @@ RedirectException
|
||||
previous class is deprecated.
|
||||
|
||||
This exception is a special case allowing for overriding of all other response routing and
|
||||
forcing a redirect to a specific route or URL:
|
||||
forcing a redirect to a specific URI:
|
||||
|
||||
.. literalinclude:: errors/010.php
|
||||
|
||||
``$uri`` may be a URI path relative to baseURL, or a complete URL. You can also supply a
|
||||
``$uri`` is a URI path relative to baseURL. You can also supply a
|
||||
redirect code to use instead of the default (``302``, "temporary redirect"):
|
||||
|
||||
.. literalinclude:: errors/011.php
|
||||
|
@ -81,7 +81,7 @@ Each handler's section will have one property in common: ``handles``, which is a
|
||||
|
||||
.. literalinclude:: logging/004.php
|
||||
|
||||
Modifying the Message With Context
|
||||
Modifying the Message with Context
|
||||
==================================
|
||||
|
||||
You will often want to modify the details of your message based on the context of the event being logged.
|
||||
|
@ -22,8 +22,12 @@ Instantiating
|
||||
*************
|
||||
|
||||
There are several ways that a new Time instance can be created. The first is simply to create a new instance
|
||||
like any other class. When you do it this way, you can pass in a string representing the desired time. This can
|
||||
be any string that PHP's strtotime function can parse:
|
||||
like any other class.
|
||||
|
||||
When you do it this way, you can pass in a string representing the desired time. This can
|
||||
be any string that PHP's `strtotime()`_ function can parse:
|
||||
|
||||
.. _strtotime(): https://www.php.net/manual/en/function.strtotime.php
|
||||
|
||||
.. literalinclude:: time/001.php
|
||||
|
||||
@ -159,7 +163,7 @@ toDateTimeString()
|
||||
==================
|
||||
|
||||
This is the first of three helper methods to work with the `IntlDateFormatter <https://www.php.net/manual/en/class.intldateformatter.php>`_ without having to remember their values.
|
||||
This will return a localized version of string formatted as (Y-m-d H:i:s):
|
||||
This will return a localized version of string formatted as (``Y-m-d H:i:s``):
|
||||
|
||||
.. literalinclude:: time/016.php
|
||||
|
||||
|
@ -231,7 +231,7 @@ In controller:
|
||||
.. note:: Using ``getFiles()`` is more appropriate.
|
||||
|
||||
*********************
|
||||
Working With the File
|
||||
Working with the File
|
||||
*********************
|
||||
|
||||
Once you've retrieved the UploadedFile instance, you can retrieve information about the file in safe ways, as well as
|
||||
|
@ -57,7 +57,7 @@ are handled automatically by the class or the database, so we don't want to chan
|
||||
class as the ``$returnType``. This ensures that all methods on the model that return rows from the database will return
|
||||
instances of our User Entity class instead of an object or array like normal.
|
||||
|
||||
Working With the Entity Class
|
||||
Working with the Entity Class
|
||||
-----------------------------
|
||||
|
||||
Now that all of the pieces are in place, you would work with the Entity class as you would any other class:
|
||||
|
@ -7,7 +7,7 @@ Localization
|
||||
:depth: 3
|
||||
|
||||
********************
|
||||
Working With Locales
|
||||
Working with Locales
|
||||
********************
|
||||
|
||||
CodeIgniter provides several tools to help you localize your application for different languages. While full
|
||||
|
@ -249,7 +249,7 @@ Asserts that an input tag exists with the name and value:
|
||||
|
||||
.. literalinclude:: response/029.php
|
||||
|
||||
Working With JSON
|
||||
Working with JSON
|
||||
=================
|
||||
|
||||
Responses will frequently contain JSON responses, especially when working with API methods. The following methods
|
||||
@ -280,7 +280,7 @@ assertJSONExact($test)
|
||||
|
||||
Similar to ``assertJSONFragment()``, but checks the entire JSON response to ensure exact matches.
|
||||
|
||||
Working With XML
|
||||
Working with XML
|
||||
================
|
||||
|
||||
getXML()
|
||||
|
Loading…
x
Reference in New Issue
Block a user