Skip to content

docs: add about Config in Modules#5366

Merged
kenjis merged 5 commits intocodeigniter4:developfrom
kenjis:docs-add-about-config-in-modules
Nov 24, 2021
Merged

docs: add about Config in Modules#5366
kenjis merged 5 commits intocodeigniter4:developfrom
kenjis:docs-add-about-config-in-modules

Conversation

@kenjis
Copy link
Copy Markdown
Member

@kenjis kenjis commented Nov 21, 2021

Description
See #5356

  • add about config() preferApp and Registrars

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • User guide updated
  • [] Conforms to style guide

@kenjis kenjis added the documentation Pull requests for documentation only label Nov 21, 2021
@kenjis kenjis changed the title docs: add Config in Modules docs: add about Config in Modules Nov 21, 2021
Comment thread user_guide_src/source/general/modules.rst Outdated

Config files are automatically discovered whenever using the **config()** function that is always available.

.. note:: **config()** finds the file in **app/Config/** when there is a class with the same shortname,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add also on the disabling of the $preferApp option if this behavior is not desired.

Copy link
Copy Markdown
Member Author

@kenjis kenjis Nov 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no way to do so. And it is by design.
I understand that users should not use the same short classname in modules.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More docs are good! But we do already cover this in Factories: https://codeigniter.com/user_guide/concepts/factories.html#factories-options

Maybe adding a link back to there, "for more information".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MGatner @paulbalandan I added more explanation for config().

Co-authored-by: John Paul E. Balandan, CPA <51850998+paulbalandan@users.noreply.github.com>
@kenjis kenjis requested a review from MGatner November 22, 2021 00:11
Copy link
Copy Markdown
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small rewording suggestion.

Comment thread user_guide_src/source/general/modules.rst Outdated
Co-authored-by: MGatner <mgatner@icloud.com>
@kenjis kenjis requested a review from MGatner November 23, 2021 01:17
@kenjis kenjis merged commit 2413c8c into codeigniter4:develop Nov 24, 2021
@kenjis kenjis deleted the docs-add-about-config-in-modules branch November 24, 2021 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Pull requests for documentation only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants