Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 3 to 4 Upgrade Helper
#21

(This post was last modified: 06-17-2024, 09:43 PM by win123139.)

(12-01-2023, 02:24 PM)kenjis Wrote: @GreTaurus Implement the feature and send a pull request.

Or you can manually upgrade only the class that is using group_start() to CI4.
See https://codeigniter4.github.io/CodeIgnit...y-grouping

You are already using CI4, so you can use it without the upgrade helper.
The upgrade helper is just a wrapper for CI4.
Sorry for dump question but i have a code 
$this->db->count_all_results('cms_news');
and get a errorr
Call to undefined method Kenjis\CI3Compatible\Database\CI_DB::count_all_results() 

How can i use countAllResults like CI4 . If your helper doesn't have that function, how can i extend it? . Can i use both CI3 and CI4 syntax in the same model ?
Reply
#22

(06-17-2024, 09:42 PM)win123139 Wrote: How can i use countAllResults like CI4 .

Please write your code according to CI4 syntax without using the upgrade helper feature at all.

(06-17-2024, 09:42 PM)win123139 Wrote: If your helper doesn't have that function, how can i extend it?

You cannot extend it. Create your fork project and add code.

(06-17-2024, 09:42 PM)win123139 Wrote: Can i use both CI3 and CI4 syntax in the same model ?

No.
Reply
#23

(06-18-2024, 09:12 PM)kenjis Wrote:
(06-17-2024, 09:42 PM)win123139 Wrote: How can i use countAllResults like CI4 .

Please write your code according to CI4 syntax without using the upgrade helper feature at all.

(06-17-2024, 09:42 PM)win123139 Wrote: If your helper doesn't have that function, how can i extend it?

You cannot extend it. Create your fork project and add code.

(06-17-2024, 09:42 PM)win123139 Wrote: Can i use both CI3 and CI4 syntax in the same model ?

No.

Thank you for your reply. There is no way to inherit or extend it without forking the project. I just want to add or modify if there is a missing function in a simple way
Reply
#24

If you can send Pull Requests, feel free to send.
Reply
#25

(06-19-2024, 01:28 AM)kenjis Wrote: If you can send Pull Requests, feel free to send.
Sorry I encountered a rather strange bug $this->form_validation->run() always returns false I tried $this->form_validation->error_array() but didn't see any rules violation
Reply
#26

(This post was last modified: 07-07-2024, 08:24 PM by win123139.)

(06-19-2024, 01:28 AM)kenjis Wrote: If you can send Pull Requests, feel free to send.
Sorry I encountered a strange bug when $this->form_validation->run() always returns false.
I tried $this->form_validation->error_array() but didn't see any rules violation
[Image: Screenshot-2024-07-08-101708.png]
Reply




Theme © iAndrew 2016 - Forum software by © MyBB