Every woman’s body is unique, and while My Pregnancy Calculator provides medically reviewed, research-based estimates through our pregnancy and fertility tools, these results are designed to guide you — not replace — consultations with qualified healthcare professionals. Our pregnancy calculators, baby growth trackers, and health guides are built to support informed decision-making, from conception to postpartum wellness and beyond.
↧
A New Project Started for Support Women Pregnancy
↧
Intellij IDEA / PHPStorm Plugin
Hi folks!
As I recently wrote in Slack I think about to contribute the CI4 from DX point of view and I'd like to propose a tight PHPStorm integration with the CI4 framework:
- autocompletion
- references search
- inspections
- quick fixes
- etc
Is there anyone who prefer PHPStorm in CI4 development?
The plugin is for frameworks users, not core developers itself (but sometimes yes).
Last time I use CodeIgniter was 2015 maybe. I really like to see that it's another PHP player who has big enough audience.
I would need your help to build the plugin, especially the most important cases where the plugin may bring the most help, i.e. validation rules: set_rules(
'username', 'Username',
'required|min_lengths[5]|max_length[12]|is_unique[users.username]',
array(
'required' => 'You have not provided %s.',
'is_unique' => 'This %s already exists.'
)
);
Almost all these strings can be completed and referenced by the plugin. It also may show warning if `min_lengths` doesn't exist and suggest to use `min_length`.
It will be a lot of work, but with your help I think we can do it.
What do you think?
As I recently wrote in Slack I think about to contribute the CI4 from DX point of view and I'd like to propose a tight PHPStorm integration with the CI4 framework:
- autocompletion
- references search
- inspections
- quick fixes
- etc
Is there anyone who prefer PHPStorm in CI4 development?
The plugin is for frameworks users, not core developers itself (but sometimes yes).
Last time I use CodeIgniter was 2015 maybe. I really like to see that it's another PHP player who has big enough audience.
I would need your help to build the plugin, especially the most important cases where the plugin may bring the most help, i.e. validation rules: set_rules(
'username', 'Username',
'required|min_lengths[5]|max_length[12]|is_unique[users.username]',
array(
'required' => 'You have not provided %s.',
'is_unique' => 'This %s already exists.'
)
);
Almost all these strings can be completed and referenced by the plugin. It also may show warning if `min_lengths` doesn't exist and suggest to use `min_length`.
It will be a lot of work, but with your help I think we can do it.
What do you think?
↧
↧
getRow() returns a result object whose elements are not accesible
I have a query that is running well in phpMyAdmin with one row result. When I run the same query in CI4, I get a result whose components (elements/properties) are not accessible.
The $query->getResultObject() function returns an array of objects. I am trying to access a property from one of the objects so returned but I keep getting the error message "Undefined property: stdClass::$propertyName".
Here are the sequence of statements I used to inspect the results from the database.
PHP Code:
The $query->getRow() function a single result row. I used it to inspect as follows
PHP Code:
Then with an 'if' statement as follows, I noted that the code in the 'if' statement body executes without any problem, but the value retrieved are not accessible outside the 'if'. See below.
PHP Code:
I am unable to move on with my project. Could this be a bug in CI_VERSION = '4.6.3'?
Other details
The $query->getResultObject() function returns an array of objects. I am trying to access a property from one of the objects so returned but I keep getting the error message "Undefined property: stdClass::$propertyName".
Here are the sequence of statements I used to inspect the results from the database.
PHP Code:
Code:
$allRecords = $query->getResultObject(); //no problem
$firstRecord = $allRecords[0]; //Undefined array key 0
$firstRecord = $query->getResultObject()[0]; //Undefined array key 0
dd($allRecords); //lists all the property-values pairs The $query->getRow() function a single result row. I used it to inspect as follows
PHP Code:
Code:
$firstRecord = $query->getRow(); //no problem
$program = $firstRecord->program; //Attempt to read property "program" on null
dd(is_null($firstRecord)); //false
dd(property_exists($firstRecord, 'program')); //true
$program = $query->getRow()->program; //Attempt to read property "program" on null
dd($firstRecord); //lists all the property-values pairs Then with an 'if' statement as follows, I noted that the code in the 'if' statement body executes without any problem, but the value retrieved are not accessible outside the 'if'. See below.
PHP Code:
Code:
$allRecords = $query->getResultObject();
$program1 = null;
$firstRecord = null;
if ( count($allRecords) > 0 )
{
$firstRecord = $allRecords[0]; //executes
$program1 = $firstRecord->program; //executes
dd($program1); //$program1 string (24) "202510100749458709480211"
}
$program2 = $firstRecord->program; //Attempt to read property "program" on null
dd($program2); //$program2 string (24) "202510100749458709480211" I am unable to move on with my project. Could this be a bug in CI_VERSION = '4.6.3'?
Other details
- Server version: 10.11.13-MariaDB - MariaDB Server
- Apache/2.4.65 (Fedora Linux)
- PHP version: 8.4.13
↧
Thoughts on Using Third-Party App Stores for CodeIgniter Projects?
Hey everyone, I’ve been exploring different ways to distribute apps and stumbled across a few third-party app stores. I’m curious—has anyone here used them for CodeIgniter-based projects or even just in a PHP/web app context?
I’m interested in hearing about your experiences in terms of reliability, security, and overall user reach. Are there any pitfalls to watch out for, or maybe some advantages over the official stores? Also, how do you handle updates and compatibility issues when your app is on multiple platforms?
Would love to get some insights from people who have actually tried this rather than just theoretical pros and cons. Any tips or lessons learned would be super helpful!
I’m interested in hearing about your experiences in terms of reliability, security, and overall user reach. Are there any pitfalls to watch out for, or maybe some advantages over the official stores? Also, how do you handle updates and compatibility issues when your app is on multiple platforms?
Would love to get some insights from people who have actually tried this rather than just theoretical pros and cons. Any tips or lessons learned would be super helpful!
↧
PHP 8.4.14. Released.
PHP 8.4.14. This is a bug fix release.
↧
↧
Coming in 4.7: Controller Attributes
One of the things I'd like to see is a push towards simplifying again. I think the Auto-Routing (Improved) is a great direction to lean new developers toward. i think the mental model might just seem a little less complex than the defined routes that we added in 4. Don't get me wrong, the defined routes are powerful, and they serve as excellent documentation. But for those just getting started. or those that prefer things a little simpler, the auto-routing is fantastic. It was missing features that you could get through defined routes, though.
So, to attempt to bring feature parity between defined routes and auto-routing, we are adding Controller Attributes in 4.7. There are three atributes currently defined, but they pack a lot of features into them.
Filters
Any of the defined Controller Filters can be run either on the controller as a whole, or on a single method:
Restrict
You can restrict the controller, or a single method, by environment, host, or subdomain:
Cache
This is one that I've thought about for a long time but adding it in isolation never felt right. Combined with the other features, it seemed like the perfect time.
This allows you to easily specify that the output of a controller's method should be cached. This means that the method never actually gets executed while it's cached.
Unless I missed something, that should see feature parity when you realize that prefixes and groups, etc are already handled by the auto-routing method itself.
I hope you'll find this helpful.
The merged PR can be seen here: https://github.com/codeigniter4/CodeIgniter4/pull/9745
So, to attempt to bring feature parity between defined routes and auto-routing, we are adding Controller Attributes in 4.7. There are three atributes currently defined, but they pack a lot of features into them.
Filters
Any of the defined Controller Filters can be run either on the controller as a whole, or on a single method:
PHP Code:
#[Filter(by: 'group', having: ['admin', 'superadmin'])]
class AdminController extends BaseController
{
#[Filter(by: 'permission', having: ['users.manage'])]
public function users()
{
// Will have 'group' filter with ['admin', 'superadmin']
// and 'permission' filter with ['users.manage']
}
}
Restrict
You can restrict the controller, or a single method, by environment, host, or subdomain:
PHP Code:
#[Restrict(environment: ['development', '!production'])]
class HomeController extends BaseController
{
// Restrict access by hostname
#[Restrict(hostname: 'localhost')]
public function index()
{
}
// Multiple allowed hosts
#[Restrict(hostname: ['localhost', '127.0.0.1', 'dev.example.com'])]
public function devOnly()
{
}
// Restrict to subdomain, e.g. admin.example.com
#[Restrict(subdomain: 'admin')]
public function deleteItem($id)
{
}
}
Cache
This is one that I've thought about for a long time but adding it in isolation never felt right. Combined with the other features, it seemed like the perfect time.
This allows you to easily specify that the output of a controller's method should be cached. This means that the method never actually gets executed while it's cached.
PHP Code:
class HomeController extends BaseController
{
// Cache this method's response for 2 hours
#[Cache(for: 2 * HOUR)]
public function index()
{
return view('welcome_message');
}
// Custom cache key
#[Cache(for: 10 * MINUTE, key: 'custom_cache_key')]
public function custom()
{
return 'This response is cached with a custom key for 10 minutes.';
}
}
Unless I missed something, that should see feature parity when you realize that prefixes and groups, etc are already handled by the auto-routing method itself.
I hope you'll find this helpful.
The merged PR can be seen here: https://github.com/codeigniter4/CodeIgniter4/pull/9745
↧
Coming in 4.7: API Improvements
I've been thinking a lot about CodeIgniter's place in the market recently. One place that I think CodeIgniter is quite strongly placed is for building API's, and API's are only growing in usage to complement heavy Javascript. frontends, acting as MCP servers, etc.
We already have some decent tools to help out with that, but I think that we can add some tools to make CodeIgniter very attractive for those types of projects. In the 4.7 release, we have already made some strides toward that, and I still have a couple of more ideas I'd like to implement.
Here's a quick. breakdown of what's already been accepted and merged in:
API Response Pagination
A new method, paginate(), has been added to the APIResponseTrait to help standardize and provide consistent, additional information for API clients, with very little work on the developer's part.
While this example shows using a model, it also works with a query builder instance like you would get from.
This would return a response shaped like:
[json]
{
"data": [
{
"id": 1,
"username": "admin",
"email": "admin@example.com"
},
{
"id": 2,
"username": "user",
"email": "user@example.com"
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 2,
"totalPages": 1
},
"links": {
"self": "http://example.com/users?page=1",
"first": "http://example.com/users?page=1",
"last": "http://example.com/users?page=1",
"next": null,
"previous": null
}
}
[/json]
This also follows best practices and RFC 8288 by setting the Links header with the same links in our response, and the X-Total-Count header with the total number of results. This provides information for both the human-readable portion used in frontend work, and with some machine readable information in the headers that is much easier and less error prone to be parsed.
API Transformers
Second, we have provided a simple mechanism for Transformers - classes that convert your raw database results to a safe, structured format to pass back to the API client. This is widely considered a must-have best practice so that sensitive information isn't accidentally returned from API calls.
We have kept this simple in implementation, but with enough flexibility to keep it useful. They're simple to create:
This example shows the data as an array received from the database. If you're using Entities, you would of course have full access to any computed properties, etc to use within the Transformer. In your controller you can simply do:
This shows transforming both a single resource and any number of resources. This also works with the new paginate method shown above:
I won't give examples here, but you can define functions that will automatically include other data. You can use this for include related model's data, etc.
Finally, we give the API client some flexibility by allowing them to choose to limit which includes are actually included, or to restrict the fields returned.
I think these two go a long way toward getting us toward really strong API powers. My next PR is getting close, providing a better error-handling mechanism using the Problem Details RFC as a standard error format. Then some new docs and probably a new generator command to quickly stub out a working API resource CRUD.
When the user
We already have some decent tools to help out with that, but I think that we can add some tools to make CodeIgniter very attractive for those types of projects. In the 4.7 release, we have already made some strides toward that, and I still have a couple of more ideas I'd like to implement.
Here's a quick. breakdown of what's already been accepted and merged in:
API Response Pagination
A new method, paginate(), has been added to the APIResponseTrait to help standardize and provide consistent, additional information for API clients, with very little work on the developer's part.
PHP Code:
class UserController extends BaseController
{
use ResponseTrait;
public function index()
{
$model = model(UserModel::class)
->where('active', 1);
return $this->paginate($model, 20);
}
}
While this example shows using a model, it also works with a query builder instance like you would get from
Code:
db_connect()->table('users')This would return a response shaped like:
[json]
{
"data": [
{
"id": 1,
"username": "admin",
"email": "admin@example.com"
},
{
"id": 2,
"username": "user",
"email": "user@example.com"
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 2,
"totalPages": 1
},
"links": {
"self": "http://example.com/users?page=1",
"first": "http://example.com/users?page=1",
"last": "http://example.com/users?page=1",
"next": null,
"previous": null
}
}
[/json]
This also follows best practices and RFC 8288 by setting the Links header with the same links in our response, and the X-Total-Count header with the total number of results. This provides information for both the human-readable portion used in frontend work, and with some machine readable information in the headers that is much easier and less error prone to be parsed.
API Transformers
Second, we have provided a simple mechanism for Transformers - classes that convert your raw database results to a safe, structured format to pass back to the API client. This is widely considered a must-have best practice so that sensitive information isn't accidentally returned from API calls.
We have kept this simple in implementation, but with enough flexibility to keep it useful. They're simple to create:
PHP Code:
class UserTransformer extends BaseTransformer
{
public function toArray(mixed $resource): array
{
return [
'id' => $resource['id'],
'username' => $resource['name'], // Renaming the field
'email' => $resource['email'],
'member_since' => date('Y-m-d', strtotime($resource['created_at'])),
];
}
}
This example shows the data as an array received from the database. If you're using Entities, you would of course have full access to any computed properties, etc to use within the Transformer. In your controller you can simply do:
PHP Code:
class Users extends BaseController
{
use ResponseTrait;
public function show($id)
{
$user = model('UserModel')->find($id);
if (! $user) {
return $this->failNotFound('User not found');
}
$transformer = new UserTransformer();
return $this->respond($transformer->transform($user));
}
public function index()
{
$users = model('UserModel')->findAll();
$transformer = new UserTransformer();
return $this->respond($transformer->transformMany($users));
}
}
This shows transforming both a single resource and any number of resources. This also works with the new paginate method shown above:
PHP Code:
public function index()
{
$model = model(UserModel::class);
return $this->paginate(resource: $model, perPage: 20, transformWith: UserTransformer::class);
}
I won't give examples here, but you can define functions that will automatically include other data. You can use this for include related model's data, etc.
Finally, we give the API client some flexibility by allowing them to choose to limit which includes are actually included, or to restrict the fields returned.
I think these two go a long way toward getting us toward really strong API powers. My next PR is getting close, providing a better error-handling mechanism using the Problem Details RFC as a standard error format. Then some new docs and probably a new generator command to quickly stub out a working API resource CRUD.
When the user
↧
Json Exception Type Error.
When I define an undefined variable in the controller, the system throws an undefined variable error. However, since the client requests JSON, ci4 executes json_encode from jsonFormatter to send this exception as JSON.
When you print_r $data in JsonFormatter.php, you will see the following in the 6th index in Trace.
My route is as follows.
Since json_encode cannot encode this class, it returns JSON error ID 8, i.e., type Error.
The system freezes. Please tell me how to resolve this.
When you print_r $data in JsonFormatter.php, you will see the following in the 6th index in Trace.
My route is as follows.
Since json_encode cannot encode this class, it returns JSON error ID 8, i.e., type Error.
The system freezes. Please tell me how to resolve this.
PHP Code:
[6] => Array
(
[file] => codeigniter4\framework\system\CodeIgniter.php
[line] => 507
[function] => runController
[class] => CodeIgniter\CodeIgniter
[type] => ->
[args] => Array
(
[0] => App\Controllers\BackControllers\MerchantBack Object
(
[helpers:protected] => Array
(
)
[request:protected] => CodeIgniter\HTTP\IncomingRequest Object
(
[protocolVersion:protected] => 1.1
[validProtocolVersions:protected] => Array
(
[0] => 1.0
[1] => 1.1
[2] => 2.0
[3] => 3.0
)
[body:protected] =>
PHP Code:
$routes->group('merchant', static function ($routes)
{
$routes->get('lockModal/(:num)', [[MerchantBack::class, 'lockModal'], '$1']);
$routes->post('lockSwitch/(:num)', [[MerchantBack::class, 'lockSwitch'], '$1']);
});
When I define an undefined variable in the controller, the system throws an undefined variable error. However, since the client requests JSON, ci4 executes json_encode from jsonFormatter to send this exception as JSON.
↧
How to validate user bill data in CodeIgniter?
Hi everyone,
I hope you’re doing well. I’m working on a small project where users can enter their reference number and view their electricity bill amount on a CodeIgniter-based website.
I’m a beginner in CodeIgniter and PHP, so I need guidance on what is the best method to fetch user data and show the bill details. Should I store the data in a database and retrieve it with a model, or call an API directly?
If anyone has done something similar, please guide me on the controller + model structure, and how to validate user input safely.
Thanks in advance!
I hope you’re doing well. I’m working on a small project where users can enter their reference number and view their electricity bill amount on a CodeIgniter-based website.
I’m a beginner in CodeIgniter and PHP, so I need guidance on what is the best method to fetch user data and show the bill details. Should I store the data in a database and retrieve it with a model, or call an API directly?
If anyone has done something similar, please guide me on the controller + model structure, and how to validate user input safely.
Thanks in advance!
↧
↧
CI Session length 32 chars to 64 chars
Kindly help me to update ci session from 32 chars to 64 chars across the application in CodeIgniter6.4, PHP8.4, WAMP Server, keep the session persistent after login also as need session details in admin side pages.
↧
Cache config in .env
Hi,
I'm using a .env file to store all my config values.
I can put App, Cookie, Database, Routing, Session config without any problem. For that, i'm using values like app.baseURL, cookie.secure, database.default.hostname, routing.autoRoute for example. Everything works fine, excepts for Cache values. If i put cache.prefixe or cache.handler in my .env file, it's totally ignored. I have to write them directly in the Cache.php file.
Any reason why ?
Thanks for help !
I'm using a .env file to store all my config values.
I can put App, Cookie, Database, Routing, Session config without any problem. For that, i'm using values like app.baseURL, cookie.secure, database.default.hostname, routing.autoRoute for example. Everything works fine, excepts for Cache values. If i put cache.prefixe or cache.handler in my .env file, it's totally ignored. I have to write them directly in the Cache.php file.
Any reason why ?
Thanks for help !
↧
Should we replace Kint? New tool preview...
Hey all - I got a little distracted this week and thought I'd try my hand at replacing Kint so it was one less external dependency. While doing it I realized that gave us the opportunity to customize the debug dumper for CodeIgniter. I've previewed some of that in the following Loom. I also have diff and trace commands working, though I haven't tweaked them just yet.
What do you guys think? Continue on this path with replacing Kint? Or keep Kint?
Demo Video
(sorry about the audio, we moved a little while ago and my room sucks for audio at the moment...)
What do you guys think? Continue on this path with replacing Kint? Or keep Kint?
Demo Video
(sorry about the audio, we moved a little while ago and my room sucks for audio at the moment...)
↧
Integrating TikTok Video Feed or Login Feature in a CodeIgniter Project — Anyone Trie
Hey everyone,
I’ve been experimenting with adding social media integrations into a small CodeIgniter-based project, and I’m curious if anyone here has tried working with TikTok’s API — specifically for fetching public videos, embedding feeds, or implementing a “Login with TikTok” feature.
I’ve read through some of TikTok’s developer documentation, but the examples are mostly in Node.js and PHP (not specifically CodeIgniter). I’d love to know if anyone has a working example or best practices for handling authentication tokens and API calls within CodeIgniter’s structure.
Any tips or sample controller setups would be super helpful. Thanks in advance!
I’ve been experimenting with adding social media integrations into a small CodeIgniter-based project, and I’m curious if anyone here has tried working with TikTok’s API — specifically for fetching public videos, embedding feeds, or implementing a “Login with TikTok” feature.
I’ve read through some of TikTok’s developer documentation, but the examples are mostly in Node.js and PHP (not specifically CodeIgniter). I’d love to know if anyone has a working example or best practices for handling authentication tokens and API calls within CodeIgniter’s structure.
Any tips or sample controller setups would be super helpful. Thanks in advance!
↧
↧
feat(entity): Refactoring some features
I like that instead of an array, an object comes from the DB. This gives great opportunities for work. We have already improved the basic behavior of the Entity on github.
BUT it still does not work correctly enough:
I would create a new class that doesn't use magic. But this might break the system in Models, DB. Any ideas how to do this? You can separate the Storable interface, the AbstractEntity abstract class, and the StrictEntity and Entity (current) classes.
BUT it still does not work correctly enough:
- The issue is open: https://github.com/codeigniter4/CodeIgni...ssues/9777 Thanks to @michalsn, it will be approved soon.
- There is a discrepancy after retrieving from the database: https://github.com/codeigniter4/CodeIgniter4/pull/9748 I would like to discuss this with other developers.
- In v4.7, can you already remove setAttributes(), checks, and documentation? Because it's been possible to set a value for $attributes['attributes'] for a long time.
- Can you delay the creation of DataCaster if there are no values for $casts = [] or $_cast?
- __set() (line 544) $value does not take into account disabling $_cast or $casts. It is always executed. You can change it in castAs().
- Very important. Because of the magic, we have duplicate properties, if $datamap = ['uid' => 'user_id'] is configured, the object now has two identical values. I can get unpredictable behavior if the ['uid' => 123, 'user_id' => 456] property is overwritten in fill(). If it is incorrect to filter valid input keys, relying on $attributes must be combined with the $datamap array. This will allow you to set properties from both another object (uid) and an array (user_id).
- I've been trying to get rid of magic properties. It looks great, with more obvious types and behavior. Any suggestions for improvement? See https://github.com/codeigniter4/CodeIgniter4/pull/2011 and https://forum.codeigniter.com/showthread.php?tid=83597
I would create a new class that doesn't use magic. But this might break the system in Models, DB. Any ideas how to do this? You can separate the Storable interface, the AbstractEntity abstract class, and the StrictEntity and Entity (current) classes.
↧
Using Shield with a separate database
I have Shield setup and migrated using spark, all the tables are there but when I try creating a user nothing gets inserted, and there's no errors in the console, writable, or PHP logs. It just fails quietly. Is there a way to do this so it works?
Auth.php and AuthGroups.php have:
public ?string $DBGroup = 'auth';
I have a user model:
Auth.php and AuthGroups.php have:
public ?string $DBGroup = 'auth';
I have a user model:
PHP Code:
<?php
namespace App\Models;
use CodeIgniter\Shield\Models\UserModel as ShieldUserModel;
class UserModel extends ShieldUserModel {
protected $DBGroup = 'auth';
public function getDBGroup(): string {
return $this->DBGroup;
}
}
What could be wrong? Does anyone have a setup tutorial on this?
↧
Rule negation and exclusive rules for models, form and file upload validation
I would like to suggest the implementation of rule negation or the ability of setting up exclusive rules for models and form or file upload validation.
Examples:
Complement $allowedFields with a $forbiddenFields array parameter for models that allows selective blocking of specific fields instead of having to allow every field individually.
Complement the mime_in and ext_in rules with mime_ex and ext_ex rules for file upload validation. For example in situations where I only want to block upload of zip archives and .exe files.
Examples:
Complement $allowedFields with a $forbiddenFields array parameter for models that allows selective blocking of specific fields instead of having to allow every field individually.
Complement the mime_in and ext_in rules with mime_ex and ext_ex rules for file upload validation. For example in situations where I only want to block upload of zip archives and .exe files.
↧
Finally, a Windows terminal that’s fast, colorful, and easy to use
Finally, a Windows terminal that’s fast, colorful, and easy to use
It works with all OS'S not just Windows.
It works with all OS'S not just Windows.
↧
↧
forum site error
extremely minor items but chrome reports the following
1. loading the forums: Refused to execute script from 'https://forum.codeigniter.com/jscripts/theme-effects.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
2. when i create a new thread:
newthread.php?fid=24:1 Refused to execute script from 'https://forum.codeigniter.com/jscripts/theme-effects.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
newthread.php?fid=24:751 Uncaught TypeError: $(...).error is not a function
at newthread.php?fid=24:751:26
(anonymous) @ newthread.php?fid=24:751
newthread.php?fid=24:1 Refused to apply style from 'https://forum.codeigniter.com/jscripts/sceditor/styles/jquery.sceditor.defaultdark.css?ver=1832' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
bill
1. loading the forums: Refused to execute script from 'https://forum.codeigniter.com/jscripts/theme-effects.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
2. when i create a new thread:
newthread.php?fid=24:1 Refused to execute script from 'https://forum.codeigniter.com/jscripts/theme-effects.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
newthread.php?fid=24:751 Uncaught TypeError: $(...).error is not a function
at newthread.php?fid=24:751:26
(anonymous) @ newthread.php?fid=24:751
newthread.php?fid=24:1 Refused to apply style from 'https://forum.codeigniter.com/jscripts/sceditor/styles/jquery.sceditor.defaultdark.css?ver=1832' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
bill
↧
Apologies on slow site speeds recently
Hey gang -
I wanted to stop by and apologize for the slow forum speeds we've seen crop up over the last couple of months. The site has been hit by massive AI and bot traffic and, potentially, an brute force attack or two along the way. Running servers has never been my expertise, so I've been learning a lot over this time. I think tonight was my 5th attempt to combat this. I have (hopefully) found the right combination of protections (Cloudflare rules, PHP/MySQL configuration settings, fail2ban, etc) to finally give us some peace. In the last few minutes CPU usage has drop from 100% down to 12% and stayed that way for a bit.
I know of another forum that has had similar issues and they finally migrated to Discord so they didn't have to deal with it anymore. Hopefully, we won't have to do anything as drastic as that.
Anyway, please know that I'm on it and keep trying to make it run better. Hopefully, this is the needed solution and the site will be pleasant to use once more. And will stay that way.
I wanted to stop by and apologize for the slow forum speeds we've seen crop up over the last couple of months. The site has been hit by massive AI and bot traffic and, potentially, an brute force attack or two along the way. Running servers has never been my expertise, so I've been learning a lot over this time. I think tonight was my 5th attempt to combat this. I have (hopefully) found the right combination of protections (Cloudflare rules, PHP/MySQL configuration settings, fail2ban, etc) to finally give us some peace. In the last few minutes CPU usage has drop from 100% down to 12% and stayed that way for a bit.
I know of another forum that has had similar issues and they finally migrated to Discord so they didn't have to deal with it anymore. Hopefully, we won't have to do anything as drastic as that.
Anyway, please know that I'm on it and keep trying to make it run better. Hopefully, this is the needed solution and the site will be pleasant to use once more. And will stay that way.
↧
New to CI4 need help understanding route grouping with filters
Hello everyone,
I'm new to CodeIgniter and to the forum. I’ve been experimenting with CodeIgniter 4 over the past week, and I’m really impressed with how clean and lightweight it is. However, I’m still trying to wrap my head around how route groups work when combined with filters.
Specifically, I’m trying to do something like this:
The filter is working when accessing
, but it doesn’t seem to trigger when accessing sub-routes like
.
My question is:
Do route filters automatically apply to all routes inside the group, or do I need to configure something additional for nested routes?
I’ve checked the CI4 user guide but I’m still not fully sure if I’m missing a step or misunderstanding how filters cascade inside route groups.
Any clarification or examples would be greatly appreciated.
Glad to join the community and looking forward to learning more!
I'm new to CodeIgniter and to the forum. I’ve been experimenting with CodeIgniter 4 over the past week, and I’m really impressed with how clean and lightweight it is. However, I’m still trying to wrap my head around how route groups work when combined with filters.
Specifically, I’m trying to do something like this:
Code:
$routes->group('admin', ['filter' => 'auth'], static function($routes) {
$routes->get('/', 'Admin\Dashboard::index');
$routes->get('users', 'Admin\Users::index');
});Code:
/adminCode:
/admin/usersMy question is:
Do route filters automatically apply to all routes inside the group, or do I need to configure something additional for nested routes?
I’ve checked the CI4 user guide but I’m still not fully sure if I’m missing a step or misunderstanding how filters cascade inside route groups.
Any clarification or examples would be greatly appreciated.
Glad to join the community and looking forward to learning more!
↧