Skip to content

Commit 54bd8de

Browse files
committed
docs: use ":php:func:model()"
1 parent 354b43a commit 54bd8de

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

user_guide_src/source/changelogs/v4.0.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Enhancements:
1414
- Additional docs for getting started
1515
- CLI fixed to better handle complex arguments
1616
- Improvements to File class
17-
- New model() helper method for easy singleton Models.
17+
- New :php:func:`model()` helper method for easy singleton Models.
1818
- Tests completely reorganized to make app-level tests simpler out of the box.
1919

2020
Repo changes:

user_guide_src/source/concepts/factories.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ The first is ``config()`` which returns a new instance of a Config class. The on
8383
model()
8484
=======
8585

86-
The second function, ``model()`` returns a new instance of a Model class. The only required parameter is the class name:
86+
The second function, :php:func:`model()` returns a new instance of a Model class. The only required parameter is the class name:
8787

8888
.. literalinclude:: factories/009.php
8989

user_guide_src/source/installation/upgrade_models.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Upgrade Guide
2424
2. Add this line just after the opening php tag: ``namespace App\Models;``.
2525
3. Below the ``namespace App\Models;`` line add this line: ``use CodeIgniter\Model;``.
2626
4. Replace ``extends CI_Model`` with ``extends Model``.
27-
5. Instead of CI3's ``$this->load->model(x);``, you would now use ``$this->x = new X();``, following namespaced conventions for your component. Alternatively, you can use the ``model()`` function: ``$this->x = model('X');``.
27+
5. Instead of CI3's ``$this->load->model(x);``, you would now use ``$this->x = new X();``, following namespaced conventions for your component. Alternatively, you can use the :php:func:`model()` function: ``$this->x = model('X');``.
2828

2929
If you use sub-directories in your model structure you have to change the namespace according to that.
3030
Example: You have a version 3 model located in **application/models/users/user_contact.php** the namespace has to be ``namespace App\Models\Users;`` and the model path in the version 4 should look like this: **app/Models/Users/UserContact.php**

user_guide_src/source/models/model.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Accessing Models
2222
Models are typically stored in the ``app/Models`` directory. They should have a namespace that matches their
2323
location within the directory, like ``namespace App\Models``.
2424

25-
You can access models within your classes by creating a new instance or using the ``model()`` helper function.
25+
You can access models within your classes by creating a new instance or using the :php:func:`model()` helper function.
2626

2727
.. literalinclude:: model/001.php
2828

user_guide_src/source/tutorial/news_section.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ access to the current ``Request`` and ``Response`` objects, as well as the
121121
Next, there are two methods, one to view all news items, and one for a specific
122122
news item.
123123

124-
Next, the ``model()`` function is used to create the **NewsModel** instance.
124+
Next, the :php:func:`model()` function is used to create the **NewsModel** instance.
125125
This is a helper function. You can read more about it :doc:`here </general/common_functions>`.
126126
You could also write ``$model = new NewsModel();``, if you don't use it.
127127

0 commit comments

Comments
 (0)