Skip to content

Commit 921dbbe

Browse files
committed
docs: add other samle code
1 parent ca40054 commit 921dbbe

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

  • user_guide_src/source/models/model

user_guide_src/source/models/model/001.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
// Create a new class manually.
44
$userModel = new \App\Models\UserModel();
55

6-
// Create a new class with the model() function.
7-
$userModel = model('App\Models\UserModel', false);
8-
96
// Create a shared instance of the model.
7+
$userModel = model('UserModel');
8+
// or
109
$userModel = model('App\Models\UserModel');
10+
// or
11+
$userModel = model(App\Models\UserModel::class);
12+
13+
// Create a new class with the model() function.
14+
$userModel = model('UserModel', false);
1115

1216
// Create shared instance with a supplied database connection.
1317
// When no namespace is given, it will search through all namespaces

0 commit comments

Comments
 (0)