@@ -65,7 +65,7 @@ Service Accessors
6565 values that are specific to the environment itself, like database
6666 settings, API keys, etc.
6767
68- .. php :function :: esc($data[, $context = 'html' [, $encoding]])
68+ .. php :function :: esc($data[, $context = 'html'[, $encoding]])
6969
7070 :param string|array $data: The information to be escaped.
7171 :param string $context: The escaping context. Default is 'html'.
@@ -89,7 +89,7 @@ Service Accessors
8989
9090 For full details, see the :doc: `helpers ` page.
9191
92- .. php :function :: lang($line[, $args[, $locale ]])
92+ .. php :function :: lang($line[, $args[, $locale]])
9393
9494 :param string $line: The line of text to retrieve
9595 :param array $args: An array of data to substitute for placeholders.
@@ -99,15 +99,15 @@ Service Accessors
9999
100100 For more information, see the :doc: `Localization </outgoing/localization >` page.
101101
102- .. php :function :: model($name [, $getShared = true [, &$conn = null ]])
102+ .. php :function :: model($name[, $getShared = true[, &$conn = null]])
103103
104104 :param string $name:
105105 :param boolean $getShared:
106106 :param ConnectionInterface|null $conn:
107107 :returns: More simple way of getting model instances
108108 :rtype: mixed
109109
110- .. php :function :: old( $key[, $default = null, [, $escape = 'html' ]] )
110+ .. php :function :: old($key[, $default = null,[, $escape = 'html']] )
111111
112112 :param string $key: The name of the old form data to check for.
113113 :param mixed $default: The default value to return if $key doesn't exist.
@@ -124,7 +124,7 @@ Service Accessors
124124.. note :: If you are using the :doc:`form helper </helpers/form_helper>`, this feature is built-in. You only
125125 need to use this function when not using the form helper.
126126
127- .. php :function :: session( [$key] )
127+ .. php :function :: session([$key])
128128
129129 :param string $key: The name of the session item to check for.
130130 :returns: An instance of the Session object if no $key, the value found in the session for $key, or null.
@@ -133,7 +133,7 @@ Service Accessors
133133 Provides a convenient way to access the session class and to retrieve a
134134 stored value. For more information, see the :doc: `Sessions </libraries/sessions >` page.
135135
136- .. php :function :: timer( [$name] )
136+ .. php :function :: timer([$name])
137137
138138 :param string $name: The name of the benchmark point.
139139 :returns: The Timer instance
@@ -147,7 +147,7 @@ Service Accessors
147147
148148 .. literalinclude :: common_functions/003.php
149149
150- .. php :function :: view ($name [, $data [, $options ]])
150+ .. php :function :: view($name[, $data[, $options]])
151151
152152 :param string $name: The name of the file to load
153153 :param array $data: An array of key/value pairs to make available within the view.
@@ -175,7 +175,7 @@ Service Accessors
175175
176176 For more details, see the :doc: `Views </outgoing/views >` page.
177177
178- .. php :function :: view_cell ( $library [, $params = null [, $ttl = 0 [, $cacheName = null]]] )
178+ .. php :function :: view_cell( $library[, $params = null[, $ttl = 0[, $cacheName = null]]])
179179
180180 :param string $library:
181181 :param null $params:
@@ -189,51 +189,51 @@ Service Accessors
189189Miscellaneous Functions
190190=======================
191191
192- .. php :function :: app_timezone ()
192+ .. php :function :: app_timezone()
193193
194194 :returns: The timezone the application has been set to display dates in.
195195 :rtype: string
196196
197197 Returns the timezone the application has been set to display dates in.
198198
199- .. php :function :: csp_script_nonce ()
199+ .. php :function :: csp_script_nonce()
200200
201201 :returns: The CSP nonce attribute for script tag.
202202 :rtype: string
203203
204204 Returns the nonce attribute for a script tag. For example: ``nonce="Eskdikejidojdk978Ad8jf" ``.
205205 See :ref: `content-security-policy `.
206206
207- .. php :function :: csp_style_nonce ()
207+ .. php :function :: csp_style_nonce()
208208
209209 :returns: The CSP nonce attribute for style tag.
210210 :rtype: string
211211
212212 Returns the nonce attribute for a style tag. For example: ``nonce="Eskdikejidojdk978Ad8jf" ``.
213213 See :ref: `content-security-policy `.
214214
215- .. php :function :: csrf_token ()
215+ .. php :function :: csrf_token()
216216
217217 :returns: The name of the current CSRF token.
218218 :rtype: string
219219
220220 Returns the name of the current CSRF token.
221221
222- .. php :function :: csrf_header ()
222+ .. php :function :: csrf_header()
223223
224224 :returns: The name of the header for current CSRF token.
225225 :rtype: string
226226
227227 The name of the header for current CSRF token.
228228
229- .. php :function :: csrf_hash ()
229+ .. php :function :: csrf_hash()
230230
231231 :returns: The current value of the CSRF hash.
232232 :rtype: string
233233
234234 Returns the current CSRF hash value.
235235
236- .. php :function :: csrf_field ()
236+ .. php :function :: csrf_field()
237237
238238 :returns: A string with the HTML for hidden input with all required CSRF information.
239239 :rtype: string
@@ -242,7 +242,7 @@ Miscellaneous Functions
242242
243243 <input type="hidden" name="{csrf_token}" value="{csrf_hash}">
244244
245- .. php :function :: csrf_meta ()
245+ .. php :function :: csrf_meta()
246246
247247 :returns: A string with the HTML for meta tag with all required CSRF information.
248248 :rtype: string
@@ -251,7 +251,7 @@ Miscellaneous Functions
251251
252252 <meta name="{csrf_header}" content="{csrf_hash}">
253253
254- .. php :function :: force_https ( $duration = 31536000 [, $request = null [, $response = null]] )
254+ .. php :function :: force_https( $duration = 31536000[, $request = null[, $response = null]])
255255
256256 :param int $duration: The number of seconds browsers should convert links to this resource to HTTPS.
257257 :param RequestInterface $request: An instance of the current Request object.
@@ -262,24 +262,24 @@ Miscellaneous Functions
262262 but through HTTPS. Will set the HTTP Strict Transport Security header, which instructs
263263 modern browsers to automatically modify any HTTP requests to HTTPS requests for the $duration.
264264
265- .. php :function :: function_usable ( $function_name )
265+ .. php :function :: function_usable( $function_name)
266266
267267 :param string $function_name: Function to check for
268268 :returns: true if the function exists and is safe to call, false otherwise.
269269 :rtype: bool
270270
271- .. php :function :: is_cli ()
271+ .. php :function :: is_cli()
272272
273273 :returns: true if the script is being executed from the command line or false otherwise.
274274 :rtype: bool
275275
276- .. php :function :: is_really_writable ( $file )
276+ .. php :function :: is_really_writable( $file)
277277
278278 :param string $file: The filename being checked.
279279 :returns: true if you can write to the file, false otherwise.
280280 :rtype: bool
281281
282- .. php :function :: log_message ($level, $message [, $context])
282+ .. php :function :: log_message($level, $message [, $context])
283283
284284 :param string $level: The level of severity
285285 :param string $message: The message that is to be logged.
@@ -295,7 +295,7 @@ Miscellaneous Functions
295295 Context can be used to substitute values in the message string. For full details, see the
296296 :doc: `Logging Information <logging >` page.
297297
298- .. php :function :: redirect( string $route )
298+ .. php :function :: redirect(string $route)
299299
300300 :param string $route: The reverse-routed or named route to redirect the user to.
301301
@@ -326,19 +326,25 @@ Miscellaneous Functions
326326
327327 .. literalinclude :: common_functions/007.php
328328
329- .. php :function :: route_to ( $method [, ...$params] )
329+ .. php :function :: route_to( $method[, ...$params])
330330
331331 :param string $method: The named route alias, or name of the controller/method to match.
332- :param mixed $params: One or more parameters to be passed to be matched in the route.
332+ :param int|string $params: One or more parameters to be passed to be matched in the route.
333333
334334 .. note :: This function requires the controller/method to have a route defined in **app/Config/routes.php**.
335335
336- Generates a URI relative to the domain name (not ** baseUrl **) for you based on either a named route alias,
336+ Generates a route for you based on either a named route alias,
337337 or a controller::method combination. Will take parameters into effect, if provided.
338338
339- For full details, see the :doc: ` /incoming/routing ` page.
339+ .. literalinclude :: common_functions/009.php
340340
341- .. php :function :: service ( $name [, ...$params] )
341+ .. literalinclude :: common_functions/010.php
342+
343+ .. note :: ``route_to()`` returns a route, not a full URI path for your site.
344+ If your **baseURL ** contains sub folders, the return value is not the same
345+ as the URI to link. In that case, just use :php:func: `url_to ` instead.
346+
347+ .. php :function :: service($name[, ...$params])
342348
343349 :param string $name: The name of the service to load
344350 :param mixed $params: One or more parameters to pass to the service method.
@@ -353,7 +359,7 @@ Miscellaneous Functions
353359
354360 .. literalinclude :: common_functions/008.php
355361
356- .. php :function :: single_service ( $name [, ...$params] )
362+ .. php :function :: single_service( $name [, ...$params])
357363
358364 :param string $name: The name of the service to load
359365 :param mixed $params: One or more parameters to pass to the service method.
@@ -372,7 +378,7 @@ Miscellaneous Functions
372378
373379 Fetch a config file item with slash appended (if not empty)
374380
375- .. php :function :: stringify_attributes ( $attributes [, $js] )
381+ .. php :function :: stringify_attributes( $attributes [, $js])
376382
377383 :param mixed $attributes: string, array of key value pairs, or object
378384 :param boolean $js: true if values do not need quotes (Javascript-style)
0 commit comments