From bce69e8924c504bbe1d23802cb43293da45dc0b8 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 16 May 2024 11:07:10 +0900 Subject: [PATCH 1/3] docs: update outdated note --- user_guide_src/source/concepts/factories.rst | 2 ++ user_guide_src/source/general/modules.rst | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/user_guide_src/source/concepts/factories.rst b/user_guide_src/source/concepts/factories.rst index 10975798490b..f98fd1726e38 100644 --- a/user_guide_src/source/concepts/factories.rst +++ b/user_guide_src/source/concepts/factories.rst @@ -86,6 +86,8 @@ The following code loads **app/Libraries/Sub/SubLib.php** if it exists: .. literalinclude:: factories/013.php :lines: 2- +.. _factories-passing-fully-qualified-classname: + Passing Fully Qualified Classname --------------------------------- diff --git a/user_guide_src/source/general/modules.rst b/user_guide_src/source/general/modules.rst index 4e5c72a9fa9b..715cdd5386e4 100644 --- a/user_guide_src/source/general/modules.rst +++ b/user_guide_src/source/general/modules.rst @@ -272,9 +272,11 @@ Model files are automatically discovered whenever using the :php:func:`model()` .. note:: We don't recommend you use the same short classname in modules. -.. note:: ``model()`` finds the file in **app/Models/** when there is a class with the same shortname, - even if you specify a fully qualified class name like ``model(\Acme\Blog\Model\PostModel::class)``. - This is because ``model()`` is a wrapper for the ``Factories`` class which uses ``preferApp`` by default. See :ref:`factories-loading-class` for more information. +.. note:: Prior to v4.4.0, ``model()`` finds the file in **app/Models/** when + there is a class with the same shortname, even if you specify a fully qualified + class name like ``model(\Acme\Blog\Model\PostModel::class)``. + See the Note in :ref:`factories-passing-fully-qualified-classname` for more + information. Views ===== From 382e32abb1e3910f2d64891777bf7c921fc1aaf5 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 16 May 2024 11:12:12 +0900 Subject: [PATCH 2/3] docs: improve link --- user_guide_src/source/general/modules.rst | 2 +- user_guide_src/source/outgoing/views.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/user_guide_src/source/general/modules.rst b/user_guide_src/source/general/modules.rst index 715cdd5386e4..67967f5ed1d8 100644 --- a/user_guide_src/source/general/modules.rst +++ b/user_guide_src/source/general/modules.rst @@ -281,6 +281,6 @@ Model files are automatically discovered whenever using the :php:func:`model()` Views ===== -Views can be loaded using the class namespace as described in the :doc:`views ` documentation: +Views can be loaded using the class namespace as described in the :ref:`views ` documentation: .. literalinclude:: modules/012.php diff --git a/user_guide_src/source/outgoing/views.rst b/user_guide_src/source/outgoing/views.rst index 611631ea6d5a..c08a3e61f97f 100644 --- a/user_guide_src/source/outgoing/views.rst +++ b/user_guide_src/source/outgoing/views.rst @@ -86,6 +86,8 @@ When doing so you will need to include the directory name loading the view. Exam .. literalinclude:: views/004.php :lines: 2- +.. _namespaced-views: + Namespaced Views ================ From 1af5192f42290c7c3564511beed79e71bf134209 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 16 May 2024 11:12:28 +0900 Subject: [PATCH 3/3] docs: make function linkable --- user_guide_src/source/general/modules.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/user_guide_src/source/general/modules.rst b/user_guide_src/source/general/modules.rst index 67967f5ed1d8..a077b8f5523d 100644 --- a/user_guide_src/source/general/modules.rst +++ b/user_guide_src/source/general/modules.rst @@ -251,7 +251,8 @@ You can specify namespaces. See :ref:`helpers-loading-from-specified-namespace` Language Files ============== -Language files are located automatically from defined namespaces when using the ``lang()`` method, as long as the +Language files are located automatically from defined namespaces when using the +:php:func:`lang()` function, as long as the file follows the same directory structures as the main application directory. Libraries