Questions tagged [codeigniter-2]

CodeIgniter 2.x is an old and no longer supported version of the popular PHP framework. Please refer to the [codeigniter] tag for more information.

CodeIgniter 2.x is an old and no longer supported version of the popular PHP framework.

The last 2.x version (2.2.6) was released on October 31st, 2015, which is also the date when security maintenance support for the 2.x version tree was officially ended.

For more and up-to-date information on the CodeIgniter framework, please refer to the tag.

Links:

3154 questions
177
votes
3 answers

Only variable references should be returned by reference - Codeigniter

After the server PHP upgrade I am getting the following error with PHP Version 5.6.2 on Apache 2.0 A PHP Error was encountered Severity: Notice Message: Only variable references should be returned by reference Filename: core/Common.php Line Number:…
Techie
  • 42,101
  • 38
  • 144
  • 232
143
votes
14 answers

Where do I put image files, css, js, etc. in Codeigniter?

Where is it acceptable to put css folders and image file folders? I was thinking inside the view folder? However the controller always reroutes the path to the base url so I have to specify the path in the .html file to where it sits, which is…
triq
  • 1,905
  • 5
  • 23
  • 24
124
votes
11 answers

CodeIgniter: How to get Controller, Action, URL information

I have these URLs: http://backend.domain.com/system/setting/edit/12 http://backend.domain.com/product/edit/1 How to get controller name, action name from these URLs. I'm CodeIgniter newbie. Are there any helper function to get this…
noname.cs
  • 1,841
  • 4
  • 16
  • 20
49
votes
5 answers

How do I run CodeIgniter migrations?

I know how to create them via http://codeigniter.com/user_guide/libraries/migration.html But once I've created my migration files, how do I run them?
Shamoon
  • 33,919
  • 63
  • 225
  • 452
47
votes
2 answers

Codeigniter: does $this->db->last_query(); execute a query?

Does query execution happen at the get_where() clause of the following codeigniter active record statement? $this->db->select('*'); $q = $this->db->get_where('Contacts', array('id' => $contact_id)); $sql = $this->db->last_query(); Or does…
James Bond
  • 689
  • 1
  • 10
  • 17
41
votes
16 answers

CodeIgniter PHP Model Access "Unable to locate the model you have specified"

I have been trying to load some models for this website I am building. However, for an unknown reason, it will bring the following error : An Error Was Encountered Unable to locate the model you have specified: logon_model Now , I have done my…
Alexandre Bolduc
  • 745
  • 2
  • 9
  • 15
35
votes
3 answers

How to detect HTTP method in CodeIgniter

How can I detect HTTP method in CodeIgniter controller class? Edited: Is there any other way than using $_SERVER['REQUEST_METHOD'] in CodeIgniter?
Sgn.
  • 1,656
  • 2
  • 14
  • 27
33
votes
9 answers

combining mysql AND OR queries in Codeigniter

I want to combine AND OR mysql queries in CI. I have already seen this thread: http://codeigniter.com/forums/viewthread/92818/. But they don't provide the exact solution there. How do I create the following query using strictly the CI framework? (I…
gopi1410
  • 6,148
  • 8
  • 38
  • 73
31
votes
11 answers

CodeIgniter: "The filetype you are attempting to upload is not allowed."

I'm experiencing a very odd upload problem. Here's the relevant view file:
StackOverflowNewbie
  • 35,023
  • 98
  • 252
  • 421
31
votes
3 answers

CodeIgniter: INSERT multiple records without cycle

It's possible to use multiple INSERT records in CodeIgniter Active Record without for, foreach and etc. ? My current code: foreach($tags as $tag) { $tag = trim($tag); $data = array( 'topic_id' => $topic_id, 'user_id' => …
Max
  • 602
  • 1
  • 6
  • 17
25
votes
4 answers

Where to place global functions in codeigniter

I have created a few utility functions like one h() that acts as echo htmlentities($var) . I want theses functions to be available everywhere . so where do i put it.
aWebDeveloper
  • 31,131
  • 35
  • 150
  • 224
24
votes
2 answers

How is Kohana different from CodeIgniter?

I've been using CodeIgniter for a long time, however lately I've been feeling the need to move to a more advanced/more OOP framework. Kohana seems to be an often recommended option, my question is, how exactly is Kohana different from CodeIgniter? A…
Click Upvote
  • 235,452
  • 251
  • 553
  • 736
23
votes
3 answers

How to route 2 parameters to a controller?

This seems really basic but i can't get the hang of it. I'm trying to send more then one parameter to a method in the controller, like this : http://localhost/ci/index.php/subjects/3/state This is the routings i've tried : $route['subjects/(:num)']…
eric.itzhak
  • 14,702
  • 26
  • 83
  • 137
22
votes
3 answers

Routing controllers in subfolders using CodeIgniter

since i want to separate the frontend and backend of the system. i have created 2 folders inside controllers as frontend and backend Below is the structure of my controller folder controller --frontend ---store.php ---processing.php …
LiveEn
  • 2,965
  • 11
  • 51
  • 94
20
votes
5 answers

Extending The Controller Class in CodeIgniter

I have class MY_Controller extends CI_Controller and common logic for big profile section, so I'va tried to create class Profile extends MY_Controller with common logic for profile section and all class related to this section should extends this…
Yekver
  • 4,347
  • 7
  • 29
  • 48
1
2 3
99 100