codeigniter

How to make a CodeIgniter project portable with redirects

I would like to set up my codeigniter projects so I can use it in any folder on my webserver. Unfortunately codeigniter requires me to specify the location in several variables of the config. This is a problem for portability. There are 3 places where I see this: 1) $config['base_url'] 2) $config['base_path'] 3) .htaccess RewriteRule...

How to use two sessions for one user in codeigniter ?

I am using the cart class for a shoping cart. Now I want to use the Simplelogin library, but the cart session is erased when I login. How can this be solved ? It is possible to use two sessions for one user ? Or maybe merge all in the same session ? ...

code igniter codeigniter question, making anchor load page containing data from referenced row in DB

Hi, Im trying to learn the code igniter library and object oriented php in general and have a question. Ok so Ive gotten as far as making a page which loads all of the rows from my database and in there, Im echoing an anchor tag which is a link to the following structure. [code]echo anchor("videos/video/$row->video_id", $row->video_ti...

Problem in updating field in codeigniter please help

It says , you must use the “set” method to update an entry. Pls help My model is $this->db->where('id', $this->uri->segment(3)); $this->db->update('mytable', $data); My controller is $data = $this->db->select('mytable', $_POST); $this->contact_model->model_update_function($data); ...

Can I overload the "view" function in CodeIgniter?

I want to have a template view that is always called and I think overloading the view function is probably the best way. Anyone know anything about that? ...

CodeIgniter: How to use WHERE clause and OR clause

Hey! I am using the following code to select from a MySQL database with a Code Igniter webapp: $query = $this->db->get_where('mytable',array('id'=>10)); This works great! But I want to write the following MySQL statement using the CI library? SELECT * FROM `mytable` WHERE `id`='10' OR `field`='value' Any ideas? Thanks! ...

CodeIgniter session object cannot be found

I'm working on a model that tracks user data and stores it in a session, where appropriate. Here's the basic structure of it: public function __construct() { parent::__construct(); $this->load->database(); $this->load->library('session'); if (!is_null($this->session->userdata('user'))) { $arrData = $this->sess...

which logger can be used with php codeigniter?

which logger can be used with php codeigniter? any suggestion... ...

Codeigniter - Is it ok to add functionality to the constructor in controllers?

I'm making a project where I want the user to search for shops in different cities and would like the url to be like this: domain/shop/city/name. So I created a controller in codeigniter called Shop. But I cant create a city function since the city part of the url changes dependent on city name. One easy way to do it would be to add a f...

Optional URL fragment in Codeigniter?

This is maybe a simple syntax question or possibly a best-practices question in terms of codeigniter. I should start by saying I'm not a PHP or Codeigniter person so trying to get up to speed on helping on a project. I've found the CI documentation fairly good. The one question I can't find an answer to is how to make part of a URL op...

CodeIgniter variable URL Routing

So basically what I want to do is have my routes.php setup so that if the route is defined then it uses that routing rule else it does something like this: domain.com/VAR/controller/method/(vars) to domain.com/controller/method/var/(vars) I think it can be done with a regex, but my regex-fu is very weak. Any tips would be greatly appre...

CodeIgniter load class into class

Hello guys, i have start working with CodeIgniter, but i can't understand one think. How do i load one class into another? $this->load->library("hello_world"); This is not working? my class -> load -> hello_world class class myclass { function test() { $this->load->library("hello_world"); $this->hello_world...

temp. download links (with codeigniter)

Hi everyone I was wondering how I could start generating temporarily download links based on files from a protected directory (e.g. /downloads/). These links need to be valid until someone used it 5 times or so or after a week or so, after that the link shouldn't be accessible anymore. Any help would be appreciated. ...

Is it bad to use a model directly from a view in codeigniter?

I know normally the data is passed thru to the view with the controller. however, currently in my view I load my model ($this->load->model('Db_model');) so i can use it in a loop to retrieve a users profile picture path from a array of IDs that is passed from controller. Will loading the db model in the view to accomplish this make my si...

Codeigniter AOP

I need a good implementation of AOP paradigm for Codeigniter PHP Framework. What do you suggest me? ...

Write permissions with Codeigniter + Simplepie

I am trying to create a simple RSS parser using the two frameworks. However I am getting PHPerrors when trying to write to my cache directory: set_cache_location(APPPATH.'cache/rss'); I am running windows 7 with XAMPP using the latest version of Simplepie from github error: A PHP Error was encountered Severity: User Warning Messa...

CodeIgniter model debugging errors

I am new to CodeIgniter, and I need a way to get more meaningful error messages. Specifically I am having trouble with some model relationships, but the error is vague. I am willing to try/install anything since I dont know how to fix this relationship. Is there a way to specify how verbose an error message is? Also, this could be relat...

Codeigniter: Combining activeRecord with manual queries?

Hi everybody, I've though a bit about the activerecord vs. manual queries in Codeigniter. ActiveRecord is awesome when it's all about standard queries and holds development time really low. However, when there's a need to add some complexity to the queries, the ActiveRecord gets quite complicated to work with. Sub queries or complex j...

codeigniter active record and mysql

I am running a query with Active Record in a modal of my codeigniter application, the query looks like this, public function selectAllJobs() { $this->db->select('*') ->from('job_listing') ->join('job_listing_has_employer_details', 'job_listing_has_employer_details.employer_details_id = job_listing.id', 'le...

PHP Frameworks: Codeigniter vs. Yii vs. Custom?

Hi everybody, I have used codeigniter for a some years now. Why I chosed to work with codeigniter back then? Pretty much for the extensive documentation that were available and the big user community. It made me as a totally newbie to the MVC pattern able to get a site up and running really fast. I think what is priorited from my side ...