Welcome Guest, Not a member yet? Register   Sign In
[split] CI4 vs CI3/CI2
#4

(08-22-2018, 01:30 AM)Pertti Wrote: The main differences seem to be some syntax, resources are now loaded differently - instead of $this->load->model() you'd now use use mymodel/mymodel and views use single function, not $this->load->view().

But biggest change for me, where I had to build similar thing for v3 myself, is Entities that extend/add to Models - https://bcit-ci.github.io/CodeIgniter4/d...ities.html

It'll basically make it much easier to load and save data from DB, instead of you having to write same functions for every single model yourself.

Pertti, something like Entities already exists in CI3

https://www.codeigniter.com/user_guide/d...lt-objects

Creating a parent class which the CodeIgniter "custom-result-object" class extended, I was able to add a save method pretty quickly.
In addition I added a "create" method to my parent MY_Model which would create a new / empty CodeIgniter "custom-result-object" which could be filled and finally saved.

DMyers
Reply


Messages In This Thread
[split] CI4 vs CI3/CI2 - by cilover85 - 08-21-2018, 11:42 PM
RE: [split] CI4 vs CI3/CI2 - by Pertti - 08-22-2018, 01:30 AM
RE: [split] CI4 vs CI3/CI2 - by dmyers - 08-22-2018, 01:05 PM
RE: [split] CI4 vs CI3/CI2 - by Pertti - 08-23-2018, 12:52 AM
RE: [split] CI4 vs CI3/CI2 - by kilishan - 08-22-2018, 06:23 AM
RE: [split] CI4 vs CI3/CI2 - by kilishan - 08-23-2018, 07:14 AM
RE: [split] CI4 vs CI3/CI2 - by Pertti - 08-23-2018, 07:24 AM
RE: [split] CI4 vs CI3/CI2 - by kilishan - 08-23-2018, 08:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB