Welcome Guest, Not a member yet? Register   Sign In
Url segment in ci4
#4

English is not my native language.
Maybe I'm too old to understand, 70, but it's also proof that I try to keep an open mind to the new, which I suppose will come to ease, simplify, etc., but the question asked by @seunex remains unanswered for me. despite the goodwill of @donpwiston and @InsiteFX.

In CI3 it was enough to use as below, in a model:
$id = $this->uri->segment(3);
$query = $this->db
->select('*')
->from('movies')
->where('id', $id) ...

Now I have to use two more lines of code otherwise it will give error:
$request = \Config\Services::request();
$uri = $request->uri;

Of course I'm no expert, I'm just curious, but I hoped the lightness, simplicity and objectivity that always characterized CodeIgniter would be further enhanced.
I built a website, local, actually a catalog of my records and movies - about 5,000 records and over 1,500 movies - with detailed information that works perfectly. All my difficulty was with learning PHP that I haven't mastered yet but learned enough to achieve my goals. So I am believing that my knowledge of PHP is quite rudimentary given the difficulties I have been encountering in converting from CI3 to CI4. Of course it wouldn't be necessary since it perfectly meets the goals, but the challenge of the task is healthy for someone my age and I wouldn't want to give up.
Thanks for the time and attention.
Reply


Messages In This Thread
Url segment in ci4 - by seunex - 11-02-2019, 01:41 AM
RE: Url segment in ci4 - by donpwinston - 11-02-2019, 08:03 AM
RE: Url segment in ci4 - by prikkles - 04-17-2020, 03:27 AM
RE: Url segment in ci4 - by Cathal - 09-01-2020, 07:46 PM
RE: Url segment in ci4 - by InsiteFX - 11-02-2019, 10:51 AM
RE: Url segment in ci4 - by wdeda - 11-08-2019, 06:58 PM
RE: Url segment in ci4 - by plaztic - 01-25-2020, 11:55 AM
RE: Url segment in ci4 - by demyr - 09-01-2020, 11:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB