↧
PHP 8.5: The Version That Will Actually Makes Life Easier
↧
Official CI Website
Just to point out...
The Codeigniter website and forum do not appear in Google results.
When you type the URL directly into the browser, you are redirected to Cloudflare, and after verification, a 404 error appears with the address https://codeigniter.com.
If you manually change the address to https://www.codeingniter.com, the site will appear correctly.
Best regards
The Codeigniter website and forum do not appear in Google results.
When you type the URL directly into the browser, you are redirected to Cloudflare, and after verification, a 404 error appears with the address https://codeigniter.com.
If you manually change the address to https://www.codeingniter.com, the site will appear correctly.
Best regards
↧
↧
PHP 8.4.13 Released!
PHP 8.4.13. This is a bug fix release.
↧
CI4sparkmake
A simple Bash utility to speed up CI4 development in MS VSCode automating the creation of common file templates and instantly opening them.
? What It Does
This script wraps around CodeIgniter's php spark make: commands to:
This is really handy for me and I use it a lot, I thought it may be useful for others. On here -> https://site.supertechman.com/posts/show/ci4sparkmake
? What It Does
This script wraps around CodeIgniter's php spark make: commands to:
- Create a new controller, model, seeder, migration, or command
- Automatically locate the generated file
- Open it directly in VS Code for immediate editing
This is really handy for me and I use it a lot, I thought it may be useful for others. On here -> https://site.supertechman.com/posts/show/ci4sparkmake
↧
I am really disappointed with CodeIgniter being cluttered
Hello,
I started using CI few days ago with high hopes, naively believing promises from CodeIgniter website. I was thinking that CI will be a minimal framework without unnecessary clutter.
My dear friends - it is bloated as hell!
From the very start with the appstarter project, I am in constant awe how many unnecessary things are already there. Config folder is so huge that file list doesn't even fit onto my screen, configuring things I am not using and I most likely never will be! Those things like Pager.php, Mimes.php or Images.php should not be in the framework at all, but if someone think they should - why aren't they already configured with some sensible defaults? Why there must be a config file for each of them cluttering my app folder even for the simplest Hello World application?
For example UserAgents.php - that is an abomination! That clearly should be an extra donwloadable service for people who need it. And even then, those arrays should be implemented somewhere deep in the code and definitely not in the Config folder as if it's something each developer using CI needs to configure himself! And this applies to the most of the stuff.
CodeIgniter boasts to be "small framework", but in my opinion it certainly is not. It might be less bloated than Symfony, but is going the same (wrong) path of including everything that is even remotely possible for someone to use and then forcing you to research what all those things are and how to disable or at least hide them if you don't need it. And I don't need like 95% percent of stuff that CI developers pushed into the framework and the starter project structure. Some things can't even be deleted and CI throws exception if you delete what apparently is clutter. Hello World application had 136 files! I think that sensible number is like 5 files for simple one-page website.
The most funny thing is that when I need something as super simple and universal as getting values from external config file into my controller or service - I have to write my own code to do that as if putting sensitive or environment-specific values outside your app folder is something unexpected :-D And your idea of Dependency Injection? Don't let me start about it...
My idea of small framework is like this:
- dependency injection
- routing
- error handling and logging
- configuration (with internal and external files)
Everything else should be optional - when you need templating, image processing, forms validation or anything else, you simply add another dependency to composer.json and then configure and add respective service into DI container.
CodeIgniter doesn't even meet my requirements for two of the four things I consider necessary (DI and external config) while it is bloated AF with hundreds of possibly optional features.
Your homepage has an audacity to say "The small framework with powerful features" - How laughable, it is not small and some really basic features are missing. I believe your mission statement should be - "CodeIgniter - 5% less clutter than Symfony, but no DI or basic functionality".
I am sorry to be so bitter, but you advertised a fresh vegetable salad and you brought me a pork fat sausage.
I started using CI few days ago with high hopes, naively believing promises from CodeIgniter website. I was thinking that CI will be a minimal framework without unnecessary clutter.
My dear friends - it is bloated as hell!
From the very start with the appstarter project, I am in constant awe how many unnecessary things are already there. Config folder is so huge that file list doesn't even fit onto my screen, configuring things I am not using and I most likely never will be! Those things like Pager.php, Mimes.php or Images.php should not be in the framework at all, but if someone think they should - why aren't they already configured with some sensible defaults? Why there must be a config file for each of them cluttering my app folder even for the simplest Hello World application?
For example UserAgents.php - that is an abomination! That clearly should be an extra donwloadable service for people who need it. And even then, those arrays should be implemented somewhere deep in the code and definitely not in the Config folder as if it's something each developer using CI needs to configure himself! And this applies to the most of the stuff.
CodeIgniter boasts to be "small framework", but in my opinion it certainly is not. It might be less bloated than Symfony, but is going the same (wrong) path of including everything that is even remotely possible for someone to use and then forcing you to research what all those things are and how to disable or at least hide them if you don't need it. And I don't need like 95% percent of stuff that CI developers pushed into the framework and the starter project structure. Some things can't even be deleted and CI throws exception if you delete what apparently is clutter. Hello World application had 136 files! I think that sensible number is like 5 files for simple one-page website.
The most funny thing is that when I need something as super simple and universal as getting values from external config file into my controller or service - I have to write my own code to do that as if putting sensitive or environment-specific values outside your app folder is something unexpected :-D And your idea of Dependency Injection? Don't let me start about it...
My idea of small framework is like this:
- dependency injection
- routing
- error handling and logging
- configuration (with internal and external files)
Everything else should be optional - when you need templating, image processing, forms validation or anything else, you simply add another dependency to composer.json and then configure and add respective service into DI container.
CodeIgniter doesn't even meet my requirements for two of the four things I consider necessary (DI and external config) while it is bloated AF with hundreds of possibly optional features.
Your homepage has an audacity to say "The small framework with powerful features" - How laughable, it is not small and some really basic features are missing. I believe your mission statement should be - "CodeIgniter - 5% less clutter than Symfony, but no DI or basic functionality".
I am sorry to be so bitter, but you advertised a fresh vegetable salad and you brought me a pork fat sausage.
↧
↧
Unconventional use of Shield
Hi,
I've been using CI4 for a few years now and i'm in the process of upgrading my login/user management from myth-auth to Shield.
My login process uses email/password authentication but is somewhat different to a typical site signup/sign site.
My system is used by construction companies, who once registered, create their own users from within the system (I intend to use Shield to provide the functionality to create users).
However, a single user (me@mydomain.com) can be work for a number of companies simultaneously.
Example:
me@mydomain.com is the owner of Company A. They create their own user for Company A (auth_identities.secret=me@mydomain.com, auth_identities.secret2=ABC)
me@mydomain.com sub-contracts for Company B. Company B creates a user (auth_identities.secret=me@mydomain.com, auth_identities.secret2=XYZ)
me@mydomain.com sub-contracts for Company C. Company C creates a user (auth_identities.secret=me@mydomain.com, auth_identities.secret2=123)
Therefore, my login flow is:
This has presented me with a number of challenges
And this is where I like to know other opinions of how best proceed securely :
Should I try create my own function(s) i.e.
Sorry a lot to consider, but CI4 has provided an excellent and very secure login/user management package, and I believe it would be foolish of me to undo all of the excellent security features with poor choices.
Thank you.
I've been using CI4 for a few years now and i'm in the process of upgrading my login/user management from myth-auth to Shield.
My login process uses email/password authentication but is somewhat different to a typical site signup/sign site.
My system is used by construction companies, who once registered, create their own users from within the system (I intend to use Shield to provide the functionality to create users).
However, a single user (me@mydomain.com) can be work for a number of companies simultaneously.
Example:
me@mydomain.com is the owner of Company A. They create their own user for Company A (auth_identities.secret=me@mydomain.com, auth_identities.secret2=ABC)
me@mydomain.com sub-contracts for Company B. Company B creates a user (auth_identities.secret=me@mydomain.com, auth_identities.secret2=XYZ)
me@mydomain.com sub-contracts for Company C. Company C creates a user (auth_identities.secret=me@mydomain.com, auth_identities.secret2=123)
Therefore, my login flow is:
- User enters email into view Username
- LoginController uses bespoke Model to get all users and associated companies, returns view Company with email
- User selects company
- LoginController uses bespoke Model to verify email & company association, returns view Password with email and company
- User enters password
- LoginController authenticates using email, password, company and logs in user.
This has presented me with a number of challenges
- I've had to change the index of auth_identities.secret from unique, as I need multiple rows with the same secret
- I cannot use the in-built User provider $users->findByCredentials(); unless I also modify the UserModel, as this will only the first row
- I cannot usefindById(); unless I fist find the id with abespoke model (which sort of negates the use of $users->findById()
And this is where I like to know other opinions of how best proceed securely :
- At various stages in the login process where the LoginController return a view and data, should the LoginController actually return data to the view (return $this->view(setting('Auth.views')['company'], ['data' => $data['email']); or should I store the data in a session and destroy the session when finished?
- Is it recommended to modify the structure of auth_identities table?
- Is it recommended to modify UserModal or should I abandon findById() & findByCredential() functions for the login process.
- If I make all of these changes, how difficult will it be to delpoy new verions of Shield
- Should I try to extend UserModal with a bespoke model. The documentation give the following example:
Code:
$users = auth()->getProvider();
$usersList = $users
->withIdentities()
->withGroups()
->withPermissions()
->findAll(10);Should I try create my own function(s) i.e.
Code:
$usersList = $users
->withCompanies()Sorry a lot to consider, but CI4 has provided an excellent and very secure login/user management package, and I believe it would be foolish of me to undo all of the excellent security features with poor choices.
Thank you.
↧
"Downloading VS Code Server" Loop when connecting via ssh
Hello! I'm trying to remote connect to beluga compute Canada through VS code, and can't seem to get through. I was connected remotely last week on Cedar, but since that is down this week, I have been trying Beluga.
I connect, get asked for my password and my duo-authentication code. After entering the screen says "Downloading VS Code Server..." And then shortly afterwards it prompts me to enter my password again and says "Setting up SSH Host beluga: ..." If I enter my login info again it continues in this loop. I have also tried leaving it to see if it eventually downloads - 30 minutes have passed and nothing.
I have read other posts on this. I tried removing the .vscode-server and .vscode-remote. I've tried using the VS code version on a different computer, it has the same issue. Everything still connects fine through just normal terminal. I'm on Windows if that helps.
I am at a bit of a loss of how to figure this out now. Any help would be appreciated!
I connect, get asked for my password and my duo-authentication code. After entering the screen says "Downloading VS Code Server..." And then shortly afterwards it prompts me to enter my password again and says "Setting up SSH Host beluga: ..." If I enter my login info again it continues in this loop. I have also tried leaving it to see if it eventually downloads - 30 minutes have passed and nothing.
I have read other posts on this. I tried removing the .vscode-server and .vscode-remote. I've tried using the VS code version on a different computer, it has the same issue. Everything still connects fine through just normal terminal. I'm on Windows if that helps.
I am at a bit of a loss of how to figure this out now. Any help would be appreciated!
↧
Server-Sent Addon Module for CI4
Ok, I made a thing that works! A Server-Sent Events Module for CI4. Great for notifications and to get sensor updates without refresh or server polling. Install via composer and configure with spark. More info and links here: https://site.supertechman.com/posts/show...ter-4-serv
My first composer package
My first contribution to CI
Many other less interesting firsts too.
Cheers
My first composer package
My first contribution to CI
Many other less interesting firsts too.
Cheers
↧
user and admin pages
Hi! i am new to this framework. i started seeing youtube how to build a blog with it. and the blog example only as admin page, but i want to create different pages for admin and users.
they both login but go to different pages. What is the best practise to achieve this
they both login but go to different pages. What is the best practise to achieve this
↧
↧
YA Simple Email Queue Addin
Hello,
I know there's an official CI queue library but it's overkill for my applications (only email queue management, not much traffic), so I have always used this simple implementation. It works well for me, it may work well for others. Take a look, use it if it makes sense to your application and let me know of any improvements I can add (better yet, contribute - there are some issues in there already). Here: https://site.supertechman.com/posts/show...ter-4-emai
Cheers.
I know there's an official CI queue library but it's overkill for my applications (only email queue management, not much traffic), so I have always used this simple implementation. It works well for me, it may work well for others. Take a look, use it if it makes sense to your application and let me know of any improvements I can add (better yet, contribute - there are some issues in there already). Here: https://site.supertechman.com/posts/show...ter-4-emai
Cheers.
↧
Shield Manual setup routes don't works
Hi as title i try to setup manually shield in hosting .
When i try to connect to https://mysite/login i have :
Can't find a route for 'GET: login'.
What can i control ?
this is my step:
-copy my vendor folder (with shield that work properly) over vendor folder in hosting
-add file Auth ,AuthGroup,Authtoken in config folder
-add helper in config/autoload
When i try to connect to https://mysite/login i have :
Can't find a route for 'GET: login'.
What can i control ?
this is my step:
-copy my vendor folder (with shield that work properly) over vendor folder in hosting
-add file Auth ,AuthGroup,Authtoken in config folder
-add helper in config/autoload
↧
Building an application from scratch using CodeIgniter + jQuery + MySQL
Hello,
The team I'm working with on a project is planning to build an application using these tools, but they are open to alternatives. Knowing that the application must be able to handle tens of thousands of user records.
Would you recommend using these tools, or would you suggest others instead?
I have already proposed React + PostgreSQL instead of jQuery and MySQL, and it's currently under consideration.
The team I'm working with on a project is planning to build an application using these tools, but they are open to alternatives. Knowing that the application must be able to handle tens of thousands of user records.
Would you recommend using these tools, or would you suggest others instead?
I have already proposed React + PostgreSQL instead of jQuery and MySQL, and it's currently under consideration.
↧
Setflashdata doesn't work inside Foreach
HI , i have a problem with flashdata , if i insert inside a foreach doesn't work , thi is my code
PHP Code:
foreach($lista_ore_lavorate_manutenzione as $ore_lavorate_manutenzione)
{
if(date('Y-m-d',strtotime($ore_lavorate_manutenzione->ora_inizio_lavorazione)) != date('Y-m-d')){
//dd('data sbagliata');
session()->setFlashdata('gestisciRecordBad', 'Data molto diversa');
//dd(session()->get('gestisciRecordBad'));
return redirect()->to('admin_Manutenzione/visualizza_manutenzione/'.$id);
}
$data_to_update = [
'ora_fine_lavorazione'=>date('Y-m-d H:i'),
];
$ore_lavorate_manutenzione_model->update($ore_lavorate_manutenzione->id,$data_to_update);
}
↧
↧
CodeIgniter\HTTP\Exceptions\HTTPException
Hi there, I need help with the following error:
CRITICAL - 2025-10-09 14:07:36 --> CodeIgniter\HTTP\Exceptions\HTTPException: 60 : SSL certificate problem: unable to get local issuer certificate
[Method: GET, Route: country_calling_code]
in SYSTEMPATH\HTTP\CURLRequest.php on line 699.
1 SYSTEMPATH\HTTP\CURLRequest.php(699): CodeIgniter\HTTP\Exceptions\HTTPException::forCurlError('60', 'SSL certificate problem: unable to get local issuer certificate')
2 SYSTEMPATH\HTTP\CURLRequest.php(381): CodeIgniter\HTTP\CURLRequest->sendRequest([...])
3 SYSTEMPATH\HTTP\CURLRequest.php(150): CodeIgniter\HTTP\CURLRequest->send('GET', 'https://ipapi.co/8.8.8.8/json/')
4 SYSTEMPATH\HTTP\CURLRequest.php(185): CodeIgniter\HTTP\CURLRequest->request('GET', 'https://ipapi.co/8.8.8.8/json/', [])
5 APPPATH\Controllers\APIController.php(15): CodeIgniter\HTTP\CURLRequest->get('https://ipapi.co/8.8.8.8/json/')
6 SYSTEMPATH\CodeIgniter.php(933): App\Controllers\APIController->getCountryCallingCode()
7 SYSTEMPATH\CodeIgniter.php(507): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\APIController))
8 SYSTEMPATH\CodeIgniter.php(354): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
9 SYSTEMPATH\Boot.php(363): CodeIgniter\CodeIgniter->run()
10 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
11 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
Some background:
- I am using localhost on WAMP64, and have installed the OpenSSL certificate and key as per their instructions, but for some reason I still get the abovementioned error.
- I have a Javascript function that calls my controller (both listed below). It's the controller that raises the error.
Javascript function :
Controller function:
}
}An
My route definition as per the following command php spark routes:
GET | country_calling_code | » | \App\Controllers\APIController::getCountryCallingCode | honeypot csrf | honeypot |
Any advice or help is appreciated.
A
CRITICAL - 2025-10-09 14:07:36 --> CodeIgniter\HTTP\Exceptions\HTTPException: 60 : SSL certificate problem: unable to get local issuer certificate
[Method: GET, Route: country_calling_code]
in SYSTEMPATH\HTTP\CURLRequest.php on line 699.
1 SYSTEMPATH\HTTP\CURLRequest.php(699): CodeIgniter\HTTP\Exceptions\HTTPException::forCurlError('60', 'SSL certificate problem: unable to get local issuer certificate')
2 SYSTEMPATH\HTTP\CURLRequest.php(381): CodeIgniter\HTTP\CURLRequest->sendRequest([...])
3 SYSTEMPATH\HTTP\CURLRequest.php(150): CodeIgniter\HTTP\CURLRequest->send('GET', 'https://ipapi.co/8.8.8.8/json/')
4 SYSTEMPATH\HTTP\CURLRequest.php(185): CodeIgniter\HTTP\CURLRequest->request('GET', 'https://ipapi.co/8.8.8.8/json/', [])
5 APPPATH\Controllers\APIController.php(15): CodeIgniter\HTTP\CURLRequest->get('https://ipapi.co/8.8.8.8/json/')
6 SYSTEMPATH\CodeIgniter.php(933): App\Controllers\APIController->getCountryCallingCode()
7 SYSTEMPATH\CodeIgniter.php(507): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\APIController))
8 SYSTEMPATH\CodeIgniter.php(354): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
9 SYSTEMPATH\Boot.php(363): CodeIgniter\CodeIgniter->run()
10 SYSTEMPATH\Boot.php(68): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
11 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
Some background:
- I am using localhost on WAMP64, and have installed the OpenSSL certificate and key as per their instructions, but for some reason I still get the abovementioned error.
- I have a Javascript function that calls my controller (both listed below). It's the controller that raises the error.
Javascript function :
Code:
async function fetchCountryCallingCode() {
try {
const response = await fetch('http://basaaro.localhost/country_calling_code'); // Adjust the endpoint as necessary
if (!response.ok) {
throw new Error('Network response was not ok'); }
const data = await response.json(); console.log('Retrieved Data:', data); } catch (error) {
console.error('Error fetching data:', error); }
[code]
}Controller function:
PHP Code:
<?php
namespace App\Controllers;
use CodeIgniter\HTTP\ResponseInterface;use CodeIgniter\RESTful\ResourceController;use Config\Services;
class APIController extends ResourceController{
public function getCountryCallingCode() {
$clientIP = $this->request->getIPAddress() !== '::1' ? $this->request->getIPAddress() : '8.8.8.8' ; $url = 'https://ipapi.co/' . $clientIP . '/json/'; $client = Services::curlrequest(); $response = $client->get($url);
if ($response->getStatusCode() === 200) {
return $this->respond(json_decode($response->getBody()), 200); } else {
return $this->fail('Unable to retrieve data from the API', $response->getStatusCode()); }
}
}An
My route definition as per the following command php spark routes:
GET | country_calling_code | » | \App\Controllers\APIController::getCountryCallingCode | honeypot csrf | honeypot |
Any advice or help is appreciated.
A
↧
Pagination - with Search results - Page 2 is blank
I am using CodeIgniter 4.6.3 with pagination.
My pagination works fine when not using a search parameter - where I just show all results.
But when I try to pass a search parameter - the first page displays correctly - but all subsequent pages are blank.
In my development window - I can see that it is because the pager has no search parameter on subsequent pages - the value is null.
How can I pass the search parameter to page the subsequent page?
public function index()
{
$CoverDescription = $this->request->getPost('CoverDescription');
$tvguides2 = model(Tv1test::class);
$tvguides1 = $tvguides2->like(field: 'CoverDescription',match: $CoverDescription,side: 'both');
$data = [
'tvguidecollection'=> $tvguides1->orderBy('IssDate','ASC')
->orderBy('IssueSubSort','ASC')
->paginate(50),
'pager' => $tvguides1->pager,];
return view('Tv2', $data);
My pagination works fine when not using a search parameter - where I just show all results.
But when I try to pass a search parameter - the first page displays correctly - but all subsequent pages are blank.
In my development window - I can see that it is because the pager has no search parameter on subsequent pages - the value is null.
How can I pass the search parameter to page the subsequent page?
public function index()
{
$CoverDescription = $this->request->getPost('CoverDescription');
$tvguides2 = model(Tv1test::class);
$tvguides1 = $tvguides2->like(field: 'CoverDescription',match: $CoverDescription,side: 'both');
$data = [
'tvguidecollection'=> $tvguides1->orderBy('IssDate','ASC')
->orderBy('IssueSubSort','ASC')
->paginate(50),
'pager' => $tvguides1->pager,];
return view('Tv2', $data);
↧
Yet another CI4 Shield library tutorial
Yet another CI4 Shield library tutorial. This one is short. This one is only 6 tiny steps from nothing to a protected page. This one is mine. This one is here: https://site.supertechman.com/posts/show...ackages:-c
Cheers
Cheers
↧
Unable to change my forum avatar pic
Hello
I have a 150x150px 6KB jpeg with my beautiful face on it that I want to set as my forum avatar. I always get an error though "The file upload failed. Please choose a valid file and try again." Anybody knows what's going on with that?
Also, because I'm curious, on a forum post, what is the text field just under the post textarea with the "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM" under it?
Thanks and cheers to all
I have a 150x150px 6KB jpeg with my beautiful face on it that I want to set as my forum avatar. I always get an error though "The file upload failed. Please choose a valid file and try again." Anybody knows what's going on with that?
Also, because I'm curious, on a forum post, what is the text field just under the post textarea with the "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM" under it?
Thanks and cheers to all
↧
↧
Tiny little snippet to dynamically fetch the latest stable release number from GH.
↧
Relationships for Models
Just like Laravel Relationships, I would like to have similar features in CodeIgniter models too.
And also support Lazy loading as well as Eager loading.
Thank you.
And also support Lazy loading as well as Eager loading.
Thank you.
↧
Michalsn\CodeIgniterGettext - ArgumentCountError
Hello,
I tried to implement Michalsn\CodeIgniterGettext CodeIgniter 4 Addon, but received an error: ArgumentCountError. It is probably due to my own error, and would kindly ask anyone to help me integrate it into CI4.
I installed the Addon using Composer, as per Documentation:
I assumed, using Composer, Autoload is already working - so I try to use is within my Controllers ( BaseController.php, initController).
But then I receive an error:
I would like to load this Service to be available on all pages, so I thought BaseController is the right way.
I used to have gettext on previous CI 3 install - but the logic was quite different there, and I am trying to get used to CI4. There in CI3 I had a function within MY_Controller, with all gettext parameters ( setlocale, putenv, bindtextdomain, bind_textdomain_codeset, textdomain) and it was working well.
I would appreciate, if anyone could help me explain how would I go making this plugin to work -- do I need to set only locale as per docs, or there are other settings (like messages folder, etc) I need to pass to the plugin.
After I make it work - I can make a Wiki / Docs page for this particular Git Project, if author is interested. He could grant me a Wiki access or I can send him .md files ( I did something similar for another project, which I used). This can help some other users as well.
I tried to implement Michalsn\CodeIgniterGettext CodeIgniter 4 Addon, but received an error: ArgumentCountError. It is probably due to my own error, and would kindly ask anyone to help me integrate it into CI4.
I installed the Addon using Composer, as per Documentation:
Code:
composer require michalsn/codeigniter-gettextI assumed, using Composer, Autoload is already working - so I try to use is within my Controllers ( BaseController.php, initController).
Code:
service('gettext')->setLocale('pl');But then I receive an error:
Code:
Too few arguments to function Michalsn\CodeIgniterGettext\Config\Services::gettext(), 0 passed ... at least 3 expected.I would like to load this Service to be available on all pages, so I thought BaseController is the right way.
I used to have gettext on previous CI 3 install - but the logic was quite different there, and I am trying to get used to CI4. There in CI3 I had a function within MY_Controller, with all gettext parameters ( setlocale, putenv, bindtextdomain, bind_textdomain_codeset, textdomain) and it was working well.
I would appreciate, if anyone could help me explain how would I go making this plugin to work -- do I need to set only locale as per docs, or there are other settings (like messages folder, etc) I need to pass to the plugin.
After I make it work - I can make a Wiki / Docs page for this particular Git Project, if author is interested. He could grant me a Wiki access or I can send him .md files ( I did something similar for another project, which I used). This can help some other users as well.
↧