Welcome Guest, Not a member yet? Register   Sign In
Search Results
    Thread: How to add variables from a second custom env file to the default one
Post: RE: How to add variables from a second custom env ...

In public/index.php, afetr PHP Code: -- $paths = new Config\Paths(); -- use CodeIgniter\Config\DotEnv; PHP Code: -- require_once $paths->systemDirectory . '/Config/DotEnv.php'; (new DotEnv(...
228 Views
2 Replies
06-14-2024, 06:32 AM
serialkiller
    Thread: How to add variables from a second custom env file to the default one
Post: How to add variables from a second custom env file...

I would need to load an additional env file in addition to the default env file. It is possible to load an env file with dedicated values and merge them with the default env file values, e.g. .env....
228 Views
2 Replies
06-14-2024, 04:12 AM
serialkiller
    Thread: Codeigniter 4 V 4.5.1 $this->db problem
Post: RE: Codeigniter 4 V 4.5.1 $this->db problem

Thanks, but I need to have the same instance in all the methods of the class, both to avoid having to declare it in each method and because when I make transactions I often call other methods from the...
1,094 Views
12 Replies
05-17-2024, 09:23 AM
serialkiller
    Thread: Codeigniter 4 V 4.5.1 $this->db problem
Post: RE: Codeigniter 4 V 4.5.1 $this->db problem

I updated from 4.46 to 4.5.1, I've made all the changes to every file in every upgrade from 4.4.6 to 4.5.1 and everything works except this one The model works for both methods only with the constr...
1,094 Views
12 Replies
05-17-2024, 06:56 AM
serialkiller
    Thread: Codeigniter 4 V 4.5.1 $this->db problem
Post: RE: Codeigniter 4 V 4.5.1 $this->db problem

I think I don't understand. If in my model I do:  PHP Code: -- $this->db->table('mytable')...  -- I get the error: Call to a member function table() on null Shouldn't $this->db be available in t...
1,094 Views
12 Replies
05-17-2024, 06:27 AM
serialkiller
    Thread: Codeigniter 4 V 4.5.1 $this->db problem
Post: RE: Codeigniter 4 V 4.5.1 $this->db problem

I'm talking about model code
1,094 Views
12 Replies
05-17-2024, 05:02 AM
serialkiller
    Thread: Codeigniter 4 V 4.5.1 $this->db problem
Post: RE: Codeigniter 4 V 4.5.1 $this->db problem

The documentation is not clear to me, can you give me a practical example I can't do as in CI3 and continue using $this->db->table(), are there any problems with this? PHP Code: -- public function ...
1,094 Views
12 Replies
05-17-2024, 03:08 AM
serialkiller
    Thread: Codeigniter 4 V 4.5.1 $this->db problem
Post: Codeigniter 4 V 4.5.1 $this->db problem

I updated to version 4.5.1 and now $this->db is protected, how can I query tables other than the one set in the model in $table? Until previous versions it was sufficient to do: PHP Code: -- $this...
1,094 Views
12 Replies
05-17-2024, 01:41 AM
serialkiller
    Thread: MYSQLI_OPT_LOCAL_INFILE
Post: MYSQLI_OPT_LOCAL_INFILE

Is there a way to set this parameter directly in the config/database.php settings or should it be done another way? Thanks
659 Views
8 Replies
04-08-2024, 06:21 AM
serialkiller
    Thread: Change language dynamically CI 4.4.6
Post: RE: Change language dynamically CI 4.4.6

JustJohnQ Wrote: (03-13-2024, 09:00 AM) -- Sorry, My answer was incomplete. The default language is set in the initController function in the BaseController: PHP Code: -- $session = \Config\Se...
553 Views
4 Replies
03-14-2024, 05:54 AM
serialkiller
    Thread: Change language dynamically CI 4.4.6
Post: RE: Change language dynamically CI 4.4.6

JustJohnQ Wrote: (03-13-2024, 08:35 AM) -- I am using the following code: In the top navigation, I have a dropdown menu: Code: --     
553 Views
4 Replies
03-13-2024, 08:44 AM
serialkiller
    Thread: Change language dynamically CI 4.4.6
Post: Change language dynamically CI 4.4.6

I'm trying to change the language of my app. I've tried inside the BaseController in the initController method in several ways PHP Code: -- $lingua = session('lingua'); config('App')->defaultL...
553 Views
4 Replies
03-13-2024, 07:08 AM
serialkiller
    Thread: Problem with transactions try catch
Post: RE: Problem with transactions try catch

InsiteFX Wrote: (01-10-2024, 10:34 AM) -- Try the code below using DatabaseException. PHP Code: --
655 Views
2 Replies
01-11-2024, 02:49 AM
serialkiller
    Thread: Problem with transactions try catch
Post: Problem with transactions try catch

I have a table that has a unique field, which I use to check that no identical insertions are made, this query is executed in the save_res method which is called within the transaction, as per the sim...
655 Views
2 Replies
01-10-2024, 09:56 AM
serialkiller
    Thread: Update and There is no data to update.
Post: Update and There is no data to update.

I can't figure out where the problem is. I set the model parameters PHP Code: -- protected $table         = 'myTable'; protected $primaryKey    = 'id'; protected $returnType    = 'object'; ...
1,085 Views
2 Replies
05-11-2023, 07:52 AM
serialkiller
    Thread: RESTful responds and cookies
Post: RE: RESTful responds and cookies

kenjis Wrote: (04-26-2023, 04:39 AM) -- Try PHP Code: -- $this->response->setCookie($cookie); return $this->respond($data, 200); -- -- It seems to work Thanks kenjis
938 Views
2 Replies
04-27-2023, 06:07 AM
serialkiller
    Thread: RESTful responds and cookies
Post: RESTful responds and cookies

Is there a way when responding with $this->respond() (RESTful API), to both send a json array and also send a cookie? For example, if I use $this->response(), I can do PHP Code: -- $this->respons...
938 Views
2 Replies
04-26-2023, 03:32 AM
serialkiller
    Thread: Problems with CORS in calls from React
Post: RE: Problems with CORS in calls from React

I think I have found the solution to the problem. Some requests may require a pre-flight, in my case, if the call is of type text/plain which apparently is considered "secure" the pre-flight is not p...
1,992 Views
2 Replies
04-20-2023, 04:24 AM
serialkiller
    Thread: Problems with CORS in calls from React
Post: Problems with CORS in calls from React

I am creating an app in React and I decided to use Codeigniter 4 as API endpoint, I created the CORS filter like this PHP Code: -- public function before(RequestInterface $request, $arguments = nu...
1,992 Views
2 Replies
04-20-2023, 02:04 AM
serialkiller
    Thread: Send mail from CI4, same configuration as CI3 doesn't work
Post: RE: Send mail from CI4, same configuration as CI3 ...

kenjis Wrote: (03-23-2023, 04:13 AM) -- @"serialkiller" Your CI3 config does not have smtp_crypto, but CI4 config has SMTPCrypto = 'ssl'. These configs are not the same. -- kenjis, you are always ...
1,760 Views
7 Replies
03-23-2023, 04:28 AM
serialkiller

Theme © iAndrew 2016 - Forum software by © MyBB