I am currently using Codeigniter 4.1.1 how do you retrieve data from the $afterInsert |
I am currently using Codeigniter 4.1.1 how do you retrieve the returned data from the $afterInsert callback here are my codes
my question is how to get retrive and access the returned $data from the model inside my controller (I am fairly new to codigniter any help will be appreciated) //controller `` public function newBlog(){ if($this->request->getMethod() == 'post'){ $model= new SampleBlogModel(); $model->save($_POST); } echo view('SampleBlogView'); } `` //model `` class SampleBlogModel extends Model{ protected $table = 'testdata'; protected $allowedFields = ['blogContent' , 'blogTitle']; protected $primaryKey = 'blogId'; protected $afterInsert = ['checkName']; protected function checkName(array $data){ return $data; } } `` |
Messages In This Thread |
I am currently using Codeigniter 4.1.1 how do you retrieve data from the $afterInsert - by John mark bartholomon - 04-12-2021, 10:12 PM
RE: I am currently using Codeigniter 4.1.1 how do you retrieve data from the $afterInsert - by InsiteFX - 04-13-2021, 08:29 AM
RE: I am currently using Codeigniter 4.1.1 how do you retrieve data from the $afterInsert - by John mark bartholomon - 04-14-2021, 03:22 AM
RE: I am currently using Codeigniter 4.1.1 how do you retrieve data from the $afterInsert - by InsiteFX - 04-14-2021, 11:46 AM
RE: I am currently using Codeigniter 4.1.1 how do you retrieve data from the $afterInsert - by John mark bartholomon - 04-14-2021, 06:21 PM
RE: I am currently using Codeigniter 4.1.1 how do you retrieve data from the $afterInsert - by ojmichael - 04-14-2021, 07:35 PM
|