Skip to content

Commit 7655b89

Browse files
committed
docs: imporve sample code
1 parent 804d75e commit 7655b89

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

user_guide_src/source/concepts/factories.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ In the following code, if you have ``App\Models\UserModel``, the instance will b
5959
Or you could also request a specific class:
6060

6161
.. literalinclude:: factories/002.php
62+
:lines: 2-
6263

6364
If you have only ``Blog\Models\UserModel``, the instance will be returned.
6465
But if you have both ``App\Models\UserModel`` and ``Blog\Models\UserModel``,
@@ -67,6 +68,7 @@ the instance of ``App\Models\UserModel`` will be returned.
6768
If you want to get ``Blog\Models\UserModel``, you need to disable the option ``preferApp``:
6869

6970
.. literalinclude:: factories/010.php
71+
:lines: 2-
7072

7173
See :ref:`factories-options` for the details.
7274

user_guide_src/source/concepts/factories/003.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use CodeIgniter\Config\Factories;
4+
35
class SomeOtherClass
46
{
57
public function someFunction()

0 commit comments

Comments
 (0)