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 up-to-date information on the Codeigniter framework, please refer to the tag.

Links:

3146 questions
181
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
  • 44,706
  • 42
  • 157
  • 243
146
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,967
  • 5
  • 23
  • 24
125
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,938
  • 4
  • 16
  • 25
49
votes
8 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
  • 41,293
  • 91
  • 306
  • 570
48
votes
3 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
  • 699
  • 1
  • 10
  • 17
45
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
  • 805
  • 2
  • 10
  • 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,696
  • 2
  • 14
  • 27
34
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,567
  • 9
  • 41
  • 75
33
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
  • 39,403
  • 111
  • 277
  • 441
33
votes
2 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
  • 664
  • 1
  • 6
  • 19
26
votes
7 answers

How to use composer packages in codeigniter?

I've followed this article: http://philsturgeon.co.uk/blog/2012/05/composer-with-codeigniter But I get Fatal error: Class 'Buzz\Browser' not found. What is missing from his post? My controller or application isn't namespaced. I was hoping to just be…
Tjorriemorrie
  • 16,818
  • 20
  • 89
  • 131
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
  • 36,687
  • 39
  • 170
  • 242
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…
Ali
  • 261,656
  • 265
  • 575
  • 769
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
  • 15,752
  • 26
  • 89
  • 142
21
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
  • 3,193
  • 12
  • 59
  • 104
1
2 3
99 100