Welcome Guest, Not a member yet? Register   Sign In
Search Results
    Thread: Query Helper append to existing field.
Post: RE: Query Helper append to existing field.

InsiteFX Wrote: (10-01-2020, 12:37 PM) -- If you use double quote marks you can do it like this. PHP Code: -- $this->db->set('field', "CONCAT(field, {$string})", false); -- -- Thank you, but I ...
3,256 Views
3 Replies
10-04-2020, 07:55 AM
imabot
    Thread: Query Helper append to existing field.
Post: Query Helper append to existing field.

Hi! With CodeIgniter 3, I would like to append a string to an existing field. I did something like : PHP Code: -- $this->db->where('id', $id); $this->db->set('field', "CONCAT(field, '" . $string."')...
3,256 Views
3 Replies
10-01-2020, 07:29 AM
imabot
    Thread: Redirect from outside a controller
Post: RE: Redirect from outside a controller

Thank you for the advices, I'm already able to write these codes, but that's not what I call simple and concises when you have dozen of tests. In my opinion, there is a fundamental problem with the...
4,350 Views
4 Replies
05-18-2020, 02:10 AM
imabot
    Thread: Not sure to migrate to CI4
Post: RE: Not sure to migrate to CI4

Thank you for your feedback. I know about Symfony but at the beginning, when I selected a framework, I picked CodeIgniter for its simplicity ... so your arguments do not really convinced me. Quote...
11,870 Views
15 Replies
05-18-2020, 02:09 AM
imabot
    Thread: Redirect from outside a controller
Post: RE: Redirect from outside a controller

imabot Wrote: (05-12-2020, 06:28 AM) -- Is it possible to redirect from outside a controller (from a library to a given URL for example ?). I read this question : https://forum.codeigniter.com/thr...
4,350 Views
4 Replies
05-14-2020, 11:24 PM
imabot
    Thread: Not sure to migrate to CI4
Post: RE: Not sure to migrate to CI4

A simple example: some pages are restricted to some users, depending on the user rights. I need to load the page data before checking if the current user is allowed to visit the page. Filters are not...
11,870 Views
15 Replies
05-14-2020, 08:13 AM
imabot
    Thread: Not sure to migrate to CI4
Post: RE: Not sure to migrate to CI4

John_Betong Wrote: (05-13-2020, 02:27 AM) -- @imabot, > During the last days, I try to migrate one of my site to CI4. I was never a fan of migrating and would be tempted to rewrite. Start with t...
11,870 Views
15 Replies
05-13-2020, 04:12 AM
imabot
    Thread: Not sure to migrate to CI4
Post: RE: Not sure to migrate to CI4

bivanbi Wrote: (05-12-2020, 09:21 PM) -- I understand your struggle. When I first switched to CI4, I thought it would be a matter of few touch-ups and my application would work right away. Wrong. ...
11,870 Views
15 Replies
05-13-2020, 01:52 AM
imabot
    Thread: Not sure to migrate to CI4
Post: Not sure to migrate to CI4

I developed dozen of website with CI3. During the last days, I try to migrate one of my site to CI4.  I'll be frank with you, it appears to me as a huge job and I'm not sure to continue with CI4. F...
11,870 Views
15 Replies
05-12-2020, 08:11 AM
imabot
    Thread: Redirect from outside a controller
Post: Redirect from outside a controller

Is it possible to redirect from outside a controller (from a library to a given URL for example ?). I read this question : https://forum.codeigniter.com/thread-74595-post-368427.html#pid368427 (htt...
4,350 Views
4 Replies
05-12-2020, 06:28 AM
imabot
    Thread: CI4 where should I connect to DB?
Post: RE: CI4 where should I connect to DB?

jreklund Wrote: (05-10-2020, 08:47 AM) -- @imabot: If that's in the model? For the primary database? If so, you need to configure your model first: https://codeigniter.com/user_guide/models/model.ht...
9,530 Views
9 Replies
05-11-2020, 09:06 AM
imabot
    Thread: Disable error message on a single rule in form validation
Post: RE: Disable error message on a single rule in form...

jreklund Wrote: (05-10-2020, 10:11 AM) -- That kinda what you asked, you only want it to validate if it's not empty. So remove "required" and add "permit_empty". If it's possible to disable it, it...
8,148 Views
8 Replies
05-10-2020, 11:25 AM
imabot
    Thread: Disable error message on a single rule in form validation
Post: RE: Disable error message on a single rule in form...

jreklund Wrote: (05-10-2020, 08:55 AM) -- You are looking for the rule named "permit_empty" add that to your rules string. And you can remove trim, it dosen't do anything to my knowledge. -- That n...
8,148 Views
8 Replies
05-10-2020, 09:14 AM
imabot
    Thread: Disable error message on a single rule in form validation
Post: Disable error message on a single rule in form val...

I want to disable the error message for one rule in form validation. How to do that? On the following example, if the email is provided but not valid, it should displays a message.  If the email i...
8,148 Views
8 Replies
05-10-2020, 08:16 AM
imabot
    Thread: CI4 where should I connect to DB?
Post: RE: CI4 where should I connect to DB?

Oops, it does not work : Quote: -- You must set the database table to be used with your query. -- Here is my code: Code: -- $builder = $this->table('tablename');         $builder->order...
9,530 Views
9 Replies
05-10-2020, 05:46 AM
imabot
    Thread: Custom view method
Post: RE: Custom view method

Thank you to all of you for these answers. I finally place my custom view in the BaseController since I use it everywhere in my apps: https://forum.codeigniter.com/thread-75176.html
3,426 Views
4 Replies
05-09-2020, 10:52 PM
imabot
    Thread: CI4 where should I connect to DB?
Post: RE: CI4 where should I connect to DB?

jreklund Wrote: (05-08-2020, 08:25 AM) -- $this->db are already initialized in Model, no need to connect again. Only if you don't want to extend the "helper" model created for you. https://codeignit...
9,530 Views
9 Replies
05-09-2020, 10:49 PM
imabot
    Thread: CI4 where should I connect to DB?
Post: CI4 where should I connect to DB?

I'm writing models that use query builder with joints and many other funny stuf. Since CI4, we need to manually connect to the DB : Code: -- $db = \Config\Database::connect() -- Where should I p...
9,530 Views
9 Replies
05-07-2020, 11:32 PM
imabot
    Thread: Custom view method
Post: RE: Custom view method

jreklund Wrote: (05-06-2020, 11:33 AM) -- Here are the complete code for view. You can create your own cView and put in in app/Common.php based on that. Or overwrite the system function. -- Thank f...
3,426 Views
4 Replies
05-07-2020, 09:19 PM
imabot
    Thread: Custom view method
Post: Custom view method

In CI3, I created a custom view method (cView) by extending CI_Loader : Quote: -- // My controller, log user data and search queries class MY_Loader extends CI_Loader {     public function...
3,426 Views
4 Replies
05-06-2020, 10:38 AM
imabot

Theme © iAndrew 2016 - Forum software by © MyBB