Welcome Guest, Not a member yet? Register   Sign In
Tongue Bug paginate pager in model
Posted by: rdeeceria - 06-18-2025, 10:33 AM - No Replies

Hai, i got a case, the issue is im just try to build pagination using paginate and pager in model. So i create manualy using service('pager') like the user guide, and i check this pager like $detail = $pager->getDetails(). but there is a bug in  $detail['uri']->getQuery().

My query string in browser 'limit=10&page=3&search=bar'
The pager getQuery didnt work well, the number page is not correct and sometimes the page is gone leaving the limit and search, every i reload the browser its a random.

Okay before that sorry for my bad english, and im newbie


  Website Rendering Issue
Posted by: dxbbuggydubai - 06-17-2025, 01:59 PM - Replies (3)

Anybody know about website Rendering issues? I have website showing good live but when i check my website Live Test HTML code from GSC it show many section up and down, nothing align, why this happening, any developer know why?


  Bugs in Tutorial CI4
Posted by: michel42 - 06-17-2025, 04:24 AM - Replies (6)

Hi CodeIgniter Team,
just started learning Codeigniter and doing step by step your Tutorial.
In:
https://codeigniter.com/user_guide/tutor...how-method
In Controller also in Method you use show instead of view and that doesn't work, it should be named to view
Should be changed in Routing "Routes.php", in Controller "News.php"
it was mixed with view and show


  How to display uploaded file from writable/uploads
Posted by: paulgough - 06-17-2025, 01:44 AM - Replies (1)

Hello,
I have a question. In CodeIgniter 4, how can I display the path of an uploaded file from the writable/uploads folder?

I upload various file types including images, documents, PDFs, and CSVs using the following code and store the file paths in the database.

Code:
$file->move(WRITEPATH . 'uploads', $fileName);


All uploaded records are listed on a page, and I need to open the uploaded CSV or Excel files in a new tab from this listing page.

However, I’m unable to retrieve the path from the writable/uploads folder to open it in a new tab.

Code:
<?=WRITEPATH.'uploads/'.$allList->documentCsv?>


When I copy the link and try to open it in a new tab, it downloads instead of displaying the file.

Could you please explain how to properly show the file path?


Wink trim(): Argument #1 ($string)
Posted by: exoed - 06-16-2025, 07:47 PM - No Replies

everytime i create a new project in CI4 4.6.1 with php 8.2.12 i often get this error, what is wrong?

this error comes out when i first run my application.


trim(): Argument #1 ($string) must be of type string, array given 
error at :  SYSTEMPATH\Filters\Filters.php at line 918

911      * @param array  $paths The except path patterns
912      */
913    private function checkPseudoRegex(string $uri, array $paths): bool
914    {
915        // treat each path as pseudo-regex
916        foreach ($paths as $path) {
917            // need to escape path separators
918            $path = str_replace('/', '\/', trim($path, '/ '));
919            // need to make pseudo wildcard real
920            $path = strtolower(str_replace('*', '.*', $path));
921
922            // Does this rule apply here?
923            if (preg_match('#\A' . $path . '\z#u', $uri, $match) === 1) {
924                return true;
925            }

log :
CRITICAL - 2025-06-17 01:45:17 --> TypeError: trim(): Argument #1 ($string) must be of type string, array given
[Method: GET, Route: /]
in SYSTEMPATH\Filters\Filters.php on line 918.
 1 SYSTEMPATH\Filters\Filters.php(918): trim([...], '/ ')
 2 SYSTEMPATH\Filters\Filters.php(881): CodeIgniter\Filters\Filters->checkPseudoRegex('', [...])
 3 SYSTEMPATH\Filters\Filters.php(791): CodeIgniter\Filters\Filters->pathApplies('', [...])
 4 SYSTEMPATH\Filters\Filters.php(474): CodeIgniter\Filters\Filters->processFilters('')
 5 SYSTEMPATH\Filters\Filters.php(218): CodeIgniter\Filters\Filters->initialize('')
 6 SYSTEMPATH\CodeIgniter.php(479): CodeIgniter\Filters\Filters->run('', 'before')
 7 SYSTEMPATH\CodeIgniter.php(354): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
 8 SYSTEMPATH\Boot.php(334): CodeIgniter\CodeIgniter->run()
 9 SYSTEMPATH\Boot.php(67): CodeIgniter\Boot::runCodeIgniter(Object(CodeIgniter\CodeIgniter))
10 FCPATH\index.php(59): CodeIgniter\Boot::bootWeb(Object(Config\Paths))
11 SYSTEMPATH\rewrite.php(44): require_once('C:\\xampp\\htdocs\\geminimenu\\public\\index.php')


 how can i solve this?


  transStatus error
Posted by: okatse - 06-16-2025, 11:27 AM - Replies (4)

Hi
What am I doing wrong?

PHP Code:
        $edb = \Config\Database::connect();
        $res $edb->prepare(function ($edb) {
            $query "select * from test limit :limit";
            return $edb->query($query);
        });
        $edb->transStart();
        $results $res
            
->execute(['limit' => 1])
            ->getResultArray();
        $edb->transComplete(); 
Cannot access protected property CodeIgniter\Database\Postgre\Connection::$transStatus
\Database\BasePreparedQuery.php at line 141


  Multi-dimensional Array in POST
Posted by: Gian - 06-16-2025, 10:30 AM - Replies (3)

Hi,
I make an AJAX request in POST to CI, sending some data, including some data in the format:

Code:
const args: {
"field1": {"field2":value}
};


If I print $this->request->getPost(), I display:

PHP Code:
Array(
  [field1] => Array
    (
        [field2] => value
    
)


but if I try to print $this->request->getPost(field1.field2) I always get an empty value.

Am I wrong in the declaration?


  Site main page is not working
Posted by: sslion - 06-15-2025, 04:25 AM - Replies (3)

Good afternoon. We have a website running on Codeigniter 4. The website has been working stably for more than three years, but yesterday something happened and the main page of the website stopped working, the server issues a 500 error. However, all other pages of the site are working correctly. Part of the server log is attached.
How can I fix this error?

PHP Fatal error: Uncaught ErrorException: file_get_contents(/home/c/ck42654/app/Config/Modules.php): failed to open stream: Permission denied in /home/c/ck42654/vendor/codeigniter4/framework/system/Autoloader/FileLocator.php:172
Stack trace:
#0 [internal function]: CodeIgniter\\Debug\\Exceptions->errorHandler(2, 'file_get_conten...', '/home/c/ck42654...', 172, Array)
#1 /home/c/ck42654/vendor/codeigniter4/framework/system/Autoloader/FileLocator.php(172): file_get_contents('/home/c/ck42654...')
#2 /home/c/ck42654/vendor/codeigniter4/framework/system/Config/Config.php(150): CodeIgniter\\Autoloader\\FileLocator->getClassname('/home/c/ck42654...')
#3 /home/c/ck42654/vendor/codeigniter4/framework/system/Config/Config.php(83): CodeIgniter\\Config\\Config::createClass('Modules')
#4 /home/c/ck42654/vendor/codeigniter4/framework/system/Common.php(126): CodeIgniter\\Config\\Config::get('Modules', true)
#5 /home/c/ck42654/vendor/codeigniter4/framework/system/Config/BaseConfig.php(85): config('Modules')
#6 /home/c/ck42654/vendor/codeigniter4/fra in /home/c/ck42654/vendor/codeigniter4/framework/system/Autoloader/FileLocator.php on line 172


  running codeigniter in a subdirectory + legacy autorouting results in 404
Posted by: Franky 5831 - 06-13-2025, 10:53 AM - Replies (8)

I have a codeigniter 4 app that has to live in a shared hosting enviroment and has to be in a subdirectory.
The app has been developed with legacy autorouting enabled.
The app has indexPage as index.php

All the autorouting routes end up throwing a 404 with the "index.php is not a valid controller name" statement.

1. Steps to Reproduce
2. get an apache webserver
3. set indexPage  as index.php in your app/Config/App.php
4. install codeigniter in a subdirectory:
/var/www/html/code-igniger-app
/var/www/html/other-apps-here
this way you'll access the app from http://localhost:8080/code-igniger-app/index.php
5. enable legacy autorouting and create a controller

The problem seems to be that having codeigniter 4 in a subdirectory results in the $_SERVER["SCRIPT_NAME"] variable to become: "/code-igniger-app/public/index.php".
If the SCRIPT_NAME has "/public" the parseRequestURI method from the CodeIgniter\HTTP\SiteURIFactory class on line 137 does not remove "/code-igniger-app/index.php" from the uri and it tries to use index.php as the controller name.

I have opened this issue on github: https://github.com/codeigniter4/CodeIgni...ssues/9602 but I've been told this is a misconfiguration, I tried to follow the official guide but I could not get it to work, can someone help me figure out where I've gone wrong?
Thanks


  Site main page is not working
Posted by: sslion - 06-13-2025, 07:19 AM - No Replies

Good afternoon. We have a website running on Codeigniter 4. The website has been working stably for more than three years, but yesterday something happened and the main page of the website stopped working, the server issues a 500 error. However, all other pages of the site are working correctly. Part of the server log is attached.

PHP Fatal error: Uncaught ErrorException: file_get_contents(/home/c/ck42654/app/Config/Modules.php): failed to open stream: Permission denied in /home/c/ck42654/vendor/codeigniter4/framework/system/Autoloader/FileLocator.php:172
Stack trace:
#0 [internal function]: CodeIgniter\\Debug\\Exceptions->errorHandler(2, 'file_get_conten...', '/home/c/ck42654...', 172, Array)
#1 /home/c/ck42654/vendor/codeigniter4/framework/system/Autoloader/FileLocator.php(172): file_get_contents('/home/c/ck42654...')
#2 /home/c/ck42654/vendor/codeigniter4/framework/system/Config/Config.php(150): CodeIgniter\\Autoloader\\FileLocator->getClassname('/home/c/ck42654...')
#3 /home/c/ck42654/vendor/codeigniter4/framework/system/Config/Config.php(83): CodeIgniter\\Config\\Config::createClass('Modules')
#4 /home/c/ck42654/vendor/codeigniter4/framework/system/Common.php(126): CodeIgniter\\Config\\Config::get('Modules', true)
#5 /home/c/ck42654/vendor/codeigniter4/framework/system/Config/BaseConfig.php(85): config('Modules')
#6 /home/c/ck42654/vendor/codeigniter4/fra in /home/c/ck42654/vendor/codeigniter4/framework/system/Autoloader/FileLocator.php on line 172

How can I fix this error?


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Block IP addresses of bad...
by luckmoshy
7 hours ago
The Hidden Cost of “Innov...
by LordKaos
9 hours ago
Validation does not appea...
by grimpirate
06-29-2025, 09:01 PM
Best Way to Implement Aff...
by InsiteFX
06-28-2025, 09:35 PM
Unable to scroll left nav...
by Crenel
06-28-2025, 07:58 PM
After GIT Clone: Call to ...
by paulbalandan
06-28-2025, 02:49 AM
I want to install the CI ...
by InsiteFX
06-27-2025, 03:12 AM
HTML6 and CSS5: What's ne...
by HarryKDowns
06-26-2025, 09:08 PM
Installation & Setup on W...
by mohamedtg
06-26-2025, 04:18 AM
Server Push/preloading?
by sanjay210
06-25-2025, 09:38 PM

Forum Statistics
» Members: 154,122
» Latest member: dverispb
» Forum threads: 78,433
» Forum posts: 379,682

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB