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
6
votes
3 answers

codeigniter active record where, or_where?

I am using Active Record on CodeIgniter. I am confused on which approach I should take. Currently, our login system let's the user to use username/email for the login along with the password. But my current active record, seems to let the user…
Leandro Garcia
  • 3,138
  • 11
  • 32
  • 44
6
votes
1 answer

Autoload language codeigniter

making a multi-language site with codeginiter. I have created two folders. One for french language files and one for english. When I go to autoload the languages (English and French) as such ($autoload['language'] = array('en', 'fr');) I get an…
JonYork
  • 1,223
  • 8
  • 31
  • 52
6
votes
3 answers

Pagination do not correct display page numbers Codeigniter

My controller function function test($start_from = 0) { $this->load->library('pagination'); $data = array(); $per_page = 3; $total = $this->activity_model->count_by(); $config['base_url'] = base_url() . 'test'; …
Viktors
  • 935
  • 3
  • 13
  • 33
6
votes
2 answers

What Does Doctrine Add Above Active Record - CodeIgniter?

I really like CodeIgniter's Active Record and how nicely it allows all my needed database queries. But I've also been reading about ORMs like Doctrine. When I read Doctrine's documentation, it does not seem as clear to use as Active Record, and I…
MatthewSchenker
  • 130
  • 1
  • 10
6
votes
5 answers

In Codeigniter, how to pass a third parameter to a callback (form validation)?

I am currently using the Form Validation class (on Codeigniter) and setting rules. It works like this with two parameters (codeigniter.com/user_guide/libraries/form_validation.html): $this->form_validation->set_rules('username', 'Username',…
Dacobah
  • 779
  • 3
  • 15
  • 35
6
votes
2 answers

How to send variable data when redirecting to previous page

I am using the following codes to redirect my user to previous page after a particular task is done. if (isset($_SERVER['HTTP_REFERER'])) { $this->session->set_userdata('previous_page', $_SERVER['HTTP_REFERER']); …
black_belt
  • 6,601
  • 36
  • 121
  • 185
6
votes
4 answers

Codeigniter Form Validation: How to redirect to the previous page if found any validation error?

I am using Codeigniter's validation class to validate my form. Could you please tell me how to redirect to the previous page from controller if found any validation error? In my controller: if ($this->form_validation->run() == FALSE){ //****…
black_belt
  • 6,601
  • 36
  • 121
  • 185
6
votes
4 answers

Custom error pages with templates in CodeIgniter

I'm using the template library for CodeIgniter, http://williamsconcepts.com/ci/codeigniter/libraries/template/reference.html, and now I want to implement custom error pages too. I found one method involving a MY_Router extending the default router:…
Anders
  • 12,556
  • 24
  • 104
  • 151
6
votes
3 answers

Codeigniter: Paypal IPN and csrf_protection

I'm working with codeigniter-paypal-ipn and have csrf_protection enabled. This seems to block the access from Paypal to my IPN controller. If i disable csrf_protection it works just fine, with csrf_protection enabled, paypal IPN service throws a 500…
AFRC
  • 902
  • 3
  • 9
  • 27
6
votes
1 answer

Field 'user_data' doesn't have a default value in CI 2.0.3

I used CI's user guide to create my session table. CREATE TABLE IF NOT EXISTS `sessions` ( session_id varchar(40) DEFAULT '0' NOT NULL, ip_address varchar(16) DEFAULT '0' NOT NULL, user_agent varchar(120) NOT NULL, last_activity…
zgosalvez
  • 384
  • 1
  • 5
  • 22
6
votes
3 answers

Share CI models between different applications

I'm still trying to figure out a way to get a mobile site running. I have a web app in CodeIgniter and I would like to create a mobile version of it. However, I don't want to rewrite too much of my code, especially not my models.. (Since they return…
Joris Ooms
  • 11,880
  • 17
  • 67
  • 124
6
votes
1 answer

Codeigniter not loading CI super object

I am trying to write a hook for my Codeigniter application. I'm trying to catch a session in my hook. Here is my code to load the hook: $hook['pre_controller'] = array( 'function' => 'getNav', 'filename' => 'LoadNav.php', 'filepath' =>…
criticerz
  • 3,397
  • 3
  • 23
  • 24
6
votes
5 answers

Git environment for CodeIgniter project

I'm starting of with a new CI project based on the CI 2.0 Reactor repository. Because the CI2 code is still changing, I would like to keep that code fresh, the question is how (using Git). For the non-CI folks, the basic structure of a CI2 project…
joelcox
  • 562
  • 9
  • 19
6
votes
2 answers

In Codeigniter what is the purpose of hook ? Why we have to create?

i am new to codeigniter. In Every interview all asked about hooks. i am not getting that what is hook why i have to use it ? what the benefit of it.
Hina Vaja
  • 314
  • 1
  • 5
  • 15
6
votes
2 answers

CodeIgniter `validation_errors()` is not working

I am using version CodeIgniter 2.1.4. I have problem on displaying form validation error. form validation is returning false but validation_errors() is not displaying any errors. I have tried to echo in controller and in view but no result. I am…
Sanoob
  • 2,466
  • 4
  • 30
  • 38