In a previous post (A jQuery Responsive Menu Plugin), I discussed how to use the gpResponsiveMenu jQuery plugin to create responsive menus. While developing the plugin, I tested the options with CodeIgniter (I use CodeIgniter for my demo site). I had to make minor changes to the CodeIgniter navigation in order to use the plugin.
Category Archives: Codeigniter
CodeIgniter and Flash
Codeigniter, FlashThe demo portion of my site was built using CodeIgniter. I have been working on adding some Flash/AS3 Class demos, so I had to figure out the best way to display the swf files. It was easier than I thought.
Dojo and CodeIgniter
Ajax, Codeigniter, DojoI finally found time to add my imRichEditor widget (a Dojo widget that integrates TinyMCE) to my demo site. I built my demo site using CodeIgniter and I had to figure out the best way to integrate/call the Dojo files.
Validating Forms With CodeIgniter and JQuery
Ajax, Codeigniter, JQuery, pluginsI created a JQuery Plugin, imValidateForm. As the name suggests, the plugin is used to validate forms. In this post, I will discuss how to use the imValidateForm plugin with CodeIgniter.
Multi-Purpose CodeIgniter Forms
CodeigniterOne aspect of CodeIgniter that I don’t like is the amount of view files that I have to create. Although I create folders to group relevant views, I’m always searching through files to find the view that I need. To reduce the amount of files that I need for a project, I usually create a single view file to handle both inserts and updates to a table. But I had to create a CodeIgniter Helper function in order to make it work.
Dynamic ComboBox With CodeIgniter
CodeigniterI’m updating a project that I created using CodeIgniter. I have to add a combobox (select) to a registration form that contains state names. I did not want to create a static combo box, so I created a states table in the MySQL database that I’m using for the project. The states table contains three fields (state_id, state_abbrev, state_name).
CodeIgniter and TinyMCE
CodeigniterI’m updating a project for a client that I developed using CodeIgniter. One of the updates involves adding a text editor. I decided to use TinyMCE. Integrating TinyMCE with CodeIgniter was easier than I thought.
Create a folder under the js folder and name it tiny_mce (/js/tiny_mce). Download TinyMCE and place the files in the tiny_mce folder.
PHP: Testing IPN in PayPal Sandbox
Codeigniter, PHPI just completed a website where the client uses PayPal to handle the payment transaction. I have used PayPal quite a bit in the past, but I have always had problems using IPN (Instant Payment Notification). Because of the problems, I usually opted not to use IPN, but I was determined to use it for this project. The primary problem with testing IPN is, because the transaction occurs in the background, it is difficult to figure out where the point of failure is. But that is all behind me now.
Using JQuery with CodeIgniter
Ajax, Codeigniter, JQuery, pluginsUsing JQuery with CodeIgniter is simple. In fact, using most Ajax frameworks with CodeIgniter is easy. I created a simple JQuery plugin that displays randomly selected images (imBannerRotater).
First I use CodeIgniter’s ‘base_url’ function to link the necessary Javascript files in a main view of my application:
<script type="text/javascript" src="js/jquery/jquery-1.3.1.min.js"></script> <script type="text/javascript" src="js/jquery/jquery.imBannerRotater-0.5.js"></script> |
Next, I define a Javascript variable to be used with by the plugin:
<script type="text/javascript"> //<![CDATA[ base_url = '<?= base_url();?>'; //]]> </script> |
I then use this variable in my JQuery Plugin:
$(document).ready(function(){ $(".randPic").imBannerRotater({ data_url: base_url + 'assets/sidebar/sidebar.php', base_path: base_url + 'assets/sidebar/' }); }); |
That’s about it. While this is a simple example, using CodeIgniter’s base_url function is the key to using JQuery or any other Ajax Framework.
CodeIgniter: 500 Internal Server Error
Codeigniter, PebbletI just finished a project using CodeIgniter. I ftp’d the files to the host provider’s servers. When I attempted to view the website, I received a ‘500 Internal Server Error’. Viewing the error logs, I found: SoftException in Application.cpp:252: File “/home/arrowcol/public_html/index.php” is writeable by group. I looked at the permissions of the index.php file and found that it was set to 0666, so I changed it to 0755 and the site is now up and running.