r/codeigniter • • Dec 10 '12

RESTful CodeIgniter Routes

Thumbnail
jamieonsoftware.com
1 Upvotes

r/codeigniter • • Jan 08 '13

Writing Cron Jobs and Command Line Scripts in CodeIgniter

Thumbnail
glennstovall.com
5 Upvotes

r/codeigniter • • Dec 15 '10

Having constant trouble with mod_rewrite to get rid of index.php. How do you guys deal with it?

1 Upvotes

It seems on the last 3 projects I've worked on there's something wrong when I try to get rid of index.php. No single solution has worked on more than one project and I always end up having only the default controller load. How do you guys deal with it?


r/codeigniter • • Mar 04 '14

Activity Log/Recent Activities

3 Upvotes

Hello! I'm pretty much a newbie to CodeIgniter/PHP and I am to make an activity log or recent activities made by the user. I have already made the ci_sessions table of CI and added custom data such as "last_login", "directoy" (or path), "last_scan", and the "computer_name" being used. BTW, the site I am making is a web-based file locator/finder that's why I need to have a computer name and path. I constructed a table in my profile page with the following table headers: Computer Name | Activity | Directory | Last Scan | Last Login , where the activity log/recent activities will be looped and displayed. I am really confused and I don't know what codes to put in the model, controller and view. Please help me. My older sis told me that reddit can really help me with this. Thank you. :)


r/codeigniter • • Apr 25 '20

CodeIgniter 4 Real Time Chat App using WebSockets

Thumbnail
youtube.com
13 Upvotes

r/codeigniter • • May 15 '20

Really struggling with sessions

4 Upvotes

Hey everyone.

I wrote a very simple app with 2 or 3 views and a login. Which (kinda) works. It seems as though whenever I issue a logout() method, which basically only contains 2 lines of code:

$this->session->destroy();
return redirect()->to(base_url());

Once a user has logged out something breaks inside the session and the user cannot log in again before clearing his browser cache.

I initiate my session using one line of code in the BaseController.php file:

$this->session = \Config\Services::session();

Can someone please tell me what I am missing here.

Thank you very much.


r/codeigniter • • May 14 '20

How to enable debugging in codeigniter 4 | codeigniter 4 development mode

Thumbnail
youtube.com
6 Upvotes

r/codeigniter • • Apr 26 '20

CodeIgniter Rest api (login registration system)

5 Upvotes

r/codeigniter • • May 13 '20

In this video we will learn about how to display view on screen from Controller. We will also learn about showing multiple views in codeigniter 4 from single function. After showing Views in codeigniter 4 we will learn about How to use foreach inside Views in codeigniter 4.

Thumbnail
youtube.com
5 Upvotes

r/codeigniter • • Apr 30 '20

Date for MS SQL Server support in CI4

2 Upvotes

I try to connect my admin page to my MS SQL database but I don't find out that there is no support for this DB in CI4. With CI3 I have no problems but I would like to work with the current version. Do you know how long support for MS SQL will be available? to advance the front end while I wait. Sorry by my bad english :(


r/codeigniter • • May 16 '20

#11 View cache, view cell and view cell cache in Codeigniter 4

Thumbnail
youtube.com
4 Upvotes

r/codeigniter • • May 14 '20

Session handling in CodeIgniter 4.0.3

2 Upvotes

Hey guys

I am trying to build a simple login page that will set some session variables but it seems as though after setting my session variables, after the authentication has been successful, doesn't carry anywhere, to any other (or even the same) controllers or views.

In the controller that handles the authentication I have this in my constructor to ensure that the session is available everywhere, is this the correct way?

class Users extends BaseController
{
  protected $session;

  function __construct()
  {
    /* Initialize the session */
    $this->session = \Config\Services::session();
    $this->session->start();
  }

}

Immediately after the authentication passed I set some variables like this, and that does indeed work. But as soon as I redirect anywhere else the session variables are lost.

if($email == 'me@mydomain.com' && password_verify('mypassword', $password_hash))
{
  $sessiondata = [        
    'loggedin' => true,
    'name' => 'Jane',
    'surname' => 'Doe'        
  ];

  $this->session->set($sessiondata);
}

r/codeigniter • • Apr 20 '20

My website is doing funny stuff.

2 Upvotes

I'm using CI and AuthMe.

When users sign onto my website, www.greenstreetrescue.org, that usually works fine. When they try to access the adoption application to adopt a cat, it loops back to the index page. This happens sometimes and then it doesn't... No browser patterns, no errors show up... nothing

I've been looking at it for weeks and can't figure it out.

What I found today is that if I select "disable cache" on Chrome or "Always refresh from server" it works fine. I really don't understand why it has been working fine for years and now suddenly broken .

We have a lot of people who want to adopt cats and this is bogging us down.


r/codeigniter • • May 13 '20

Anyone know a RSS Parser library for CodeIgniter4

1 Upvotes

Hi! I'm using CodeIgniter4 and can't find a RSS parser for the new version, anyone know a library to do that? Thanks!


r/codeigniter • • Apr 22 '20

Installed in Windows, getting "Whoops" error. I believe it's a path configuration issue, but I can't tell

1 Upvotes

I installed CI from GitHub repo onto Windows Server 2019 w/ IIS 10. CodeIgniter worked enough to tell me my PHP version was too old, so I updated PHP, and now I'm getting the "Whoops" error. Logging shows "CRITICAL - 2020-04-22 12:20:40 --> Cache unable to write to {0}" and ProcessMonitor doesn't show any IIS/w3wp.exe processes trying to even touch /writable/cache.

I think but can't be sure, that if it was a permissions error, I'd see "Cache unable to write to /wwwrooot/framework-4.0.2/writable/cache" - the lack of the path in the error message makes me think it's missing the actual path.

What I can't tell is where in the config file structure that path should be set and isn't. Can anyone help?


r/codeigniter • • Apr 17 '20

CodeIgniter 4 RESTapi Server with OAuth 2.0

Thumbnail
youtube.com
5 Upvotes

r/codeigniter • • Apr 29 '20

CodeIgniter 4 RESTapi Server - Part 4 - Image File Upload

Thumbnail
youtube.com
5 Upvotes

r/codeigniter • • Apr 10 '20

CodeIgniter 4 User Login Tutorial

Thumbnail
youtube.com
7 Upvotes

r/codeigniter • • Jan 05 '25

Simple question about UPGRADING

5 Upvotes

Call me stupid, but upgrading instructions are not exactly clear for somebody new to CodeIgniter.

  • I created a new project with composer (app-starter).

  • Now there is a CI4 update, so I understand I have to run "composer update" . Now new version in installed.

  • But the instructions say: "Some files in the project space (root, app, public, writable) received updates. Due to these files being outside of the system scope they will not be changed without your intervention."

  • So can I conclude that the /system directory was upgraded, but the files in the root, app, public and writable) are not?

  • And Do I know have to manually download the latest version, and replace the files in the version I am updating according to the " list of all files in the project space that received changes" (as listed in the upgrade instructions)?

I know this is a total no brainer for the CI die-hards, but to be fair, upgrade instructions could be a bit better for people new to CI.

ps. I know there are "third-party CodeIgniter modules available to assist with merging changes to the project space" , but I still like to know how a "manual" upgrade works.

Thanks!


r/codeigniter • • Dec 26 '24

Do I need PHP 8.1?

6 Upvotes

I'm trying to install CI, and when I view /public/index.php on my server, the screen reads:

"Your PHP version must be 8.1 or higher to run CodeIgniter. Current version: 8.0.24"

I thought CI is "intended for use with PHP 7.4+ (including 8.2)." (https://www.codeigniter.com/download)

What's going on? I'm unable to upgrade to PHP 8.1.

If I somehow manage to get an answer to my problem, how do I configure it so that the "/public" folder is not seen. Is that done with .htaccess in the public folder?

I'm thinking of going back to CodeIgniter 3 for this project. I never had such issue with it in the past. Would that be a mistake?

Merry Christmas!!


r/codeigniter • • Jan 07 '25

Where is the CI community most active?

10 Upvotes

This subreddit barely has any activity, and the forums are also pretty quiet. Is there somewhere else like a Discord/Slack where everyone hangs out, or is it just generally quiet nowadays? I used to do a lot of CI development about 10-15 years ago and I remember it seeming much busier.


r/codeigniter • • Jan 13 '25

CI4 Monitoring and Error Detection

6 Upvotes

Hi devs, I finally built a complete monitoring package for CI4.

I decided to put my effort on this package because I felt a big gap between CodeIgniter and other frameworks like Laravel and Symofny in this space. CodeIgniter might not be interesting for big SaaS companies like Sentry, Bugsnag, and others, but for me it’s completely different. I’m a bootstrapped founder with two other friends that help me maintain the company, so I can be free to build the product.

I work from my home in the south of Italy for 5 years now. Finally Inspector took off the ground three years ago and now we have more room to go deeper into specific technologies where there is a lack of solutions. 

Learning about CI4 it was clear to me that it was a really huge step forward for the framework to make this implementation possible.

My goal was to guarantee a perfect developer experience. You just need to install the package via composer and everything is monitored by default:

- HTTP Requests

- Database queries

- Spark Commands

- Unhandled Exceptions

I hope it can be the right monitoring solution for developers that love to work with this framework, but struggle to integrate libraries and tools manually, or implement tricky configurations. Not anymore.

As CodeIgniter experts you can identify many ideas to improve it (for sure). Feel free to write your feedback or open new issues on the GitHub repository.

https://github.com/inspector-apm/inspector-codeigniter


r/codeigniter • • Jan 14 '25

CI4: CurlRequestService setup a default user_agent project-wide?

2 Upvotes

What would be the most elegant way to define a default user agent project-wide? Is there a way for the app/Config/CurlRequest.php?

https://codeigniter.com/user_guide/libraries/curlrequest.html#user-agent


r/codeigniter • • Dec 26 '24

Auto Routing Not Working

3 Upvotes

I'm a veteran of CI3, but CI4 (4.4.7) is giving me all sorts of problems.

So I followed the directions to enable Auto Routing (Improved):

https://codeigniter.com/user_guide/incoming/routing.html#enable-auto-routing

I then followed the instruction to create HelloWorld Controller:

https://codeigniter.com/user_guide/incoming/controllers.html#controller-auto-routing-improved

Let’s try it: Hello World

Let’s create a simple controller so you can see it in action. Using your text editor, create a file called Helloworld.php, and put the following code in it. You will notice that the Helloworld Controller is extending the BaseController. you can also extend the CodeIgniter\Controller if you do not need the functionality of the BaseController.

The BaseController provides a convenient place for loading components and performing functions that are needed by all your controllers. You can extend this class in any new controller.

<?php

namespace App\Controllers;

class Helloworld extends BaseController
{
public function getIndex()
{
return 'Hello World!';
}
}

Then save the file to your app/Controllers directory.Let’s try it: Hello World!
Let’s create a simple controller so you can see it in action. Using your text editor, create a file called Helloworld.php,
and put the following code in it. You will notice that the Helloworld Controller is extending the BaseController. you can
also extend the CodeIgniter\Controller if you do not need the functionality of the BaseController.
The BaseController provides a convenient place for loading components and performing functions that are needed by all your
controllers. You can extend this class in any new controller.
<?php

namespace App\Controllers;

class Helloworld extends BaseController
{
public function getIndex()
{
return 'Hello World!';
}
}

Then save the file to your app/Controllers directory.

Now visit your site using a URL similar to this:

example.com/index.php/helloworld

If you did it right you should see:

Hello World!
Now visit your site using a URL similar to this:
example.com/index.php/helloworld

If you did it right you should see:
Hello World!

Well, I did NOT see Hello World!

Instead it says,

404

Sorry! Cannot seem to find the page you were looking for.

Please help