File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,10 +99,12 @@ Convenience Functions
9999
100100Two shortcut functions for Factories have been provided. These functions are always available.
101101
102+ .. _factories-config :
103+
102104config()
103105========
104106
105- The first is `` config() ` ` which returns a new instance of a Config class. The only required parameter is the class name:
107+ The first is :php:func: ` config() ` which returns a new instance of a Config class. The only required parameter is the class name:
106108
107109.. literalinclude :: factories/008.php
108110
Original file line number Diff line number Diff line change @@ -30,6 +30,21 @@ Service Accessors
3030
3131 .. literalinclude :: common_functions/001.php
3232
33+ .. php :function :: config(string $name[, bool $getShared = true])
34+
35+ :param string $name: The config classname.
36+ :param bool $getShared: Whether to return a shared instance.
37+ :returns: The config instances.
38+ :rtype: object|null
39+
40+ More simple way of getting config instances from Factories.
41+
42+ See :ref: `Configuration <configuration-config >` and
43+ :ref: `Factories <factories-config >` for details.
44+
45+ The ``config() `` uses ``Factories::config() `` internally.
46+ See :ref: `factories-loading-class ` for details on the first parameter ``$name ``.
47+
3348.. php :function :: cookie(string $name[, string $value = ''[, array $options = []]])
3449
3550 :param string $name: Cookie name
Original file line number Diff line number Diff line change @@ -30,10 +30,12 @@ By using the ``new`` keyword to create an instance:
3030
3131.. literalinclude :: configuration/001.php
3232
33+ .. _configuration-config :
34+
3335config()
3436--------
3537
36- By using the `` config() ` ` function:
38+ By using the :php:func: ` config() ` function:
3739
3840.. literalinclude :: configuration/002.php
3941
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ with the ``new`` command:
189189
190190.. literalinclude :: modules/008.php
191191
192- Config files are automatically discovered whenever using the `` config() ` ` function that is always available.
192+ Config files are automatically discovered whenever using the :php:func: ` config() ` function that is always available.
193193
194194.. note :: We don't recommend you use the same short classname in modules.
195195 Modules that need to override or add to known configurations in **app/Config/ ** should use :ref: `registrars `.
You can’t perform that action at this time.
0 commit comments