how to keep the variable passed to the view in codeigniter 4 |
02-25-2022, 07:54 PM
(This post was last modified: 02-26-2022, 01:46 AM by startup. Edit Reason: note for someone need )
in my controller Home.php
PHP Code: class HomeController extends BaseController{ in my view.php PHP Code: $demo =$mHome->myFunction($id); thank you @ikesela, sometime is sptupid, i fix code above this, it working PHP Code: class HomeController extends BaseController{ (02-26-2022, 01:22 AM)iRedds Wrote: You don't need to pass the model to the view. PHP Code: cateMenu =1 can you good method to get id folow cate in view page ? i know 'view_ceil' in codeigniter 4 , but id dont like this function (02-26-2022, 01:54 AM)startup Wrote:(02-26-2022, 01:22 AM)iRedds Wrote: You don't need to pass the model to the view. I don't know the logic of your application. For example, you can create a service that will prepare data for display. This is a simple example to show the concept. PHP Code: class MyService |
Welcome Guest, Not a member yet? Register Sign In |