Skip to content

Tag: codeigniter-4

How can I use route namespace?

I am creating routes in codeigniter-4 and I want to know if I can use namespace for some routes like with laravel given below: Laravel namespace Code Can I implement something similar in codeigniter-4 ? My Codeigniter code Answer Yes you can. https://codeigniter.com/user_guide/incoming/routing.html#assigning-…

How to call affected_rows method from ci4 model

I have a model that extends CI4 builtin Model.. Any idea how do i perform the following? thinking of getting it after deleting a row, most of the example using custom model, not extending ci4 model. Answer First, be sure to set your database connection up correctly in app/Config/App.php or in your .env file. …

Can’t create project with Composer

I am trying to create project with Composer using command composer create-project codeigniter4/appstarter myproject and i get this Exception [InvalidArgumentException] Could not find package codeigniter4/appstarter with stability stable in a version installable using your PHP version 5.6.40. I am using Wamp S…

Debug Toolbar in Codeigniter 4 not working

I installed Codeigniter 4.0.2 and did following changes: 1- CI_ENVIRONMENT = development in .env file 2- SetEnv CI_ENVIRONMENT development in .htaccess in public folder 3- Added $useKint = true; in main index.php file in public folder When I open at localhost, welcome page is rendered but no Debug Toolbar is …

How to get specific columns in CodeIgniter 4?

I wanna select specific columns from table. Not all columns. I’m using this but it returns all data. Answer According to the CI4 query builder documentation you can use select() in this way: where() could be possible to use in 4 ways, you can choose. This stuff should be placed in Model file, method of …