![]() |
12-27-2024, 06:13 AM
(This post was last modified: 12-27-2024, 06:26 AM by captain-sensible. Edit Reason: addition )
a start of one of my models is :
Code: <?php to use the model in a controller : Code: $this->handle = new BlogModel(); no helpers , no messing , field are declared in properties model if you follow the appropriate architecture and place your models in app/Models and use namespace, Code: namespace App\Models; Then when you instantiate with : Code: $this->handle = new BlogModel(); then class will be looked for, found and be instantiated. because we are extending "model" then various things are inbuilt |
Messages In This Thread |
Load model in helper - by 4usol - 12-27-2024, 05:41 AM
RE: Load model in helper - by captain-sensible - 12-27-2024, 06:13 AM
RE: Load model in helper - by 4usol - 12-27-2024, 09:53 AM
RE: Load model in helper - by captain-sensible - 12-28-2024, 04:50 AM
|