codeigniter

Codeignitor Global Array Declaration

I have a sequence of number like follows 1 -> 25, 2 -> 60, 3 -> 80, 4 -> 100 and so on which means that if input is 1 output will be 25 and so on...I need to store it in global array.I would like to use it in multiple pages also.In codeigniter where i can declare a global array and store all these? I am trying like as follows in...

Where do you put non-controller classes in codeigniter?

I've got a class Widgets. Widgets are made up of Doohickies. I'm never going to need to access Doohickies directly via url -- they're essentially a private class, only used by Widgets. Where do you put your code to define the Doohicky class? In /app/controllers/doohicky.php? in app/controllers/widget.php? somewhere else? Obviously, the f...

Right way of making muti-site and multi-lingual website on codeigniter

Hi there. Beforehand let me thank you all !! Really guys you help a lot. When I will finish my web site and will have much time on watching how userbase is growing I will come here again and again to answer to another people questions(if I can ) So here is the problem. I made a web-site on CodeIgniter. A social network engine. Someth...

PHP - white screen of death!

Hi everyone, After debugging a codeigniter app that were installed into a new development environment, I have started to freak out when seeing white screens with nothing more available. I have been able to solve each and every one of the errors that have caused this, but it have taken seriously way too long time. PHP error_reporting(E_...

Admin panel - what is the best way to display "static" data in the layout?

I'm about to write a admin panel for my CMS written in CodeIgniter. There will be some user information visible at all time - both in the layout's header section and the sidebar. I'm used to do it in a way that I personally hope and think could be done a lot easier, since I'm tired of sending the same parametres to the view over and over...

500 error with CodeIgniter

I have just moved my CodeIgniter project to a new server and now I'm getting a 500 error and no output from the project. It works fine on my old server and in my test environment. I'm completely stumped how to troubleshoot this, especially as there's nothing of use in the log files. Any help would be great! ...

Jqgrid + CodeIgniter

I tried to make jqgrid work with codeigniter, but I could not do it, I only want to show the data from the table in json format... but nothing happens.. but i dont know what i am doing wrong, i cant see the table with the content i am calling. my controller class Grid extends Controller { public function f() { $this->load...

Codeigniter Best Practices for Model functions

Say my application has a "Posts" model, and one of the function is add_post(), it might be something like: function add_post($data) { $this->db->insert('posts',$data); } Where $data is an array: $data = array ('datetime'=>'2010-10-10 01:11:11', 'title'=>'test','body'=>'testing'); Is this best practice? It means if you use tha...

Pass codeigniter translation array to jQuery Function

Hi, I’ve a problem by passing an array to a jQuery function. Some code: // in the language file $lang['daynames'] = array('So','Mo','Di','Mi','Do','Fr','Sa'); //In the view <script type="text/javascript" charset="utf-8"> var config = { basePath : '<?php echo $base; ?>' }; // THIS WORKS GREAT!!! var days = new array(...

Creating a mobile version for my web app in CodeIgniter

Hi there, I'm using CodeIgniter to develop a new web app, and I'd like to create a mobile version that users get redirect to when they visit it from their phones. The mobile version of the app should have a different flow, so swapping CSS/HTML files in the code is not an option for me since the mobile version and the web version will h...

Codeigniter form not submitting

I have using codeigniter form validation library to validate a form, below is the logic in my controller, public function addJob() { $this->load->model('jobwall'); if($query = $this->jobwall->getjobTitles()) { $data['select_options'] = $query; } $this->load->helper('form'); $this->load->library('form_vali...

loading css or javascript from non-public directory

is there a way to load css and/or javascript files from outside of the public web directory? for example on my hosting service i have /public_html but don't want these files to exist in the public directory and want them in a directory outside of the public directory in a sibling directory /system (i am using codeigniter) within the /sy...

PHP APC and Pecl upload progress returning false/null.

This is a long shot. I believe this might be suhosin patch issue. Here is my php from codeigniter: public function uploadprogress($id) { if ($id) { header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); echo json_encode(apc_fetch('upload_'.$id)); exit()...

CodeIgniter Production and Developpement server on the same domain. (no subdomain)

Hi, I googled this many times but now I have to ask it here. I want to make a workflow for a website for Developpement/Production. My constraint is that I use Facebook Connect (Facebook Graph now) so I need to have the dev and prod on the same domain and server. (to be able to log in and test the features) I thought I will edit the C...

Persistent memcached connection with Apache and CodeIgniter

I have a CodeIgniter project. I want to use Memcache, but I don't want to create a new connection every time index.php is loaded (which is on every page load). How can I set up Apache / CodeIgniter so that I always have access to a memcache connection, without having to re-establish it all the time? ...

mysql procedure call in codeigniter

Any simple example of mysql stored procedure and example to show how to call that procedure from codeigniter php. Any help? ...

Codeigniter return config file as array with autoload enabled

So I'm using CodeIgniter to build a website and I've made it so that all my specific settings are stored in a config file that's automatically loaded. I've also built a page that loads the settings file, makes a nice little table and allows me to edit everything from that page, afterwards it saves the entire page again (I know I could've...

Codeigniter Smiley Helper JS error

Hi. Want to use the codeigniters smiley pack . I am creating the messaging window with this code in controller I use the code from Documentation $this->load->helper('smiley'); $this->load->library('table'); $image_array = get_clickable_smileys('/files/smileys/', 'fieldMessage'); $col_array = $this->table->make_columns...

How do I call this function in CodeIgniter controller?

I've got this code, but I'm not sure I make it work: /** * Function: youtube data grabber * * @description : * @param $ : video code, url type (embed/url) * @return : data array * @author : Mamun. * @last -modified-by: Mamun. */ if (! function_exists('youtube_data_grabber')) { function youtube_data_gra...

how to change ‘item’ on Phil Sturgeon’s RESTful API

<xml> − <item> <userid>1</userid> <username>example</username> <useremail>[email protected]</useremail> </item> </xml> hi all,im new to CI,just want to know how to change <item> to something else.maybe <user> here is my model if($query->num_rows()>0){ foreach($query->result()as $row){ $data[] = $row; } return $data; } thanks ...