We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca40054 commit 921dbbeCopy full SHA for 921dbbe
1 file changed
user_guide_src/source/models/model/001.php
@@ -3,11 +3,15 @@
3
// Create a new class manually.
4
$userModel = new \App\Models\UserModel();
5
6
-// Create a new class with the model() function.
7
-$userModel = model('App\Models\UserModel', false);
8
-
9
// Create a shared instance of the model.
+$userModel = model('UserModel');
+// or
10
$userModel = model('App\Models\UserModel');
11
+$userModel = model(App\Models\UserModel::class);
12
+
13
+// Create a new class with the model() function.
14
+$userModel = model('UserModel', false);
15
16
// Create shared instance with a supplied database connection.
17
// When no namespace is given, it will search through all namespaces
0 commit comments