CodeIgniter Forums
Use Entity function in COntroller or view - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Use Entity function in COntroller or view (/showthread.php?tid=79923)



Use Entity function in COntroller or view - pippuccio76 - 08-15-2021

HI , how can i use entity  function in controller or in view ?

i have this function in Ore_giornata_quarti_dora_Entity :

PHP Code:
      function ritorna_orario_standard($id){

        $ore_giornata_quarti_dora_model= new Ore_giornata_quarti_doraModel();

        $record $ore_giornata_quarti_dora_model->find($id);

        return $record;

      


i use it on list get by  model findAll() but in a simple view or controller ?


RE: Use Entity function in COntroller or view - InsiteFX - 08-17-2021

You would need to load the class just like any other class, but using it in a Controller or View is breaking the MVC.