How to use method function modal data to view codeigniter 4.5.3 |
i have two table cate and subcate
Modal.php below PHP Code: public function getCate(){} Controller PHP Code: public function getCate(){ <strong>view</strong> PHP Code: how to get function subCate in view below: can you show me how to use function method data in view above thank
lets clarify the question ... are you saying you dont quite get how to get data from a model class , which has been instantiated in a controller and that data is passed in the controller along the lines of .
Code: Model class is say called BlogModel.php (08-29-2024, 12:57 PM)captain-sensible Wrote: lets clarify the question ... are you saying you dont quite get how to get data from a model class , which has been instantiated in a controller and that data is passed in the controller along the lines of .Thank you very much for your instructions but I want to ask if in codeigniter 4 can get methods directly in the view as codeigniter 3 or not, I can write other function in controller to pass to view by the way, thank you for your support
08-30-2024, 01:06 AM
(This post was last modified: 08-30-2024, 01:09 AM by captain-sensible. Edit Reason: error )
In certain situations, we want the user to be able to modify the theme easily without directly interacting with the controllers or models. One possible solution is to use a View Model, which allows us to request data from the View components.
CodeIgniter 4 User Guide - Building Responses - View Decorators
CodeIgniter 4 User Guide - Building Responses - View Cells What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |