Posts In "Codeigniter"

Create Simple Web Installer For Codeigniter Application

October 24th, 2012 by aditia rahman / No Comments  

     

When you installing a fresh cms on your server usually you will find a form for setting up your database setting, admin, etc, this feature often can be found on popular cms. In this post I try to create simple installer for codeigniter application, this might help after you finish create your own custom web project and don’t want to make confuse your client with manual install by editing php file.

CIBB: An Experimental Basic Forum Built With Codeigniter and Twitter Bootstrap

August 15th, 2012 by aditia rahman / 12 Comments  

     

About a month ago I have posted a post list about open source forum software based on PHP, and lately I found twitter bootstrap, is a set library for popular user interface component and interaction. In this post I only share what I’m doing with codeigniter and bootstrap for creating a simple forum software, I called CIBB (Codeigniter Bulletin Board).

For learning more about using twitter bootstrap I made this and completely using a basic bootstrap style, I only create a very basic forum software so do not expect to much features from it, but you can download and use it for any kind of purpose.

Codeigniter Little Trick: Shorten Input Form To Database Table

July 4th, 2012 by aditia rahman / No Comments  

     

In today post I have a little trick using codeigniter for inserting a row fields to database, this trick I found when I have to insert data that have many data fields for example I have 5 table each table have about 20 fields, in codeigniter we have active record class to make it easy when inserting to database. Basic codeigniter active record is

$data = array(
   'title' => 'My title' ,
   'name' => 'My Name' ,
   'date' => 'My date'
);

$this->db->insert('mytable', $data);
Form code

In the form field name I use the same name on the input fields so I can pass the input fields as array.

<form method="post" action="">
<label>Fields 1</label>
<input type="text" name="fields[fields1]"/>
<label>Fields 2</label>
<input type="text" name="fields[fields2]"/>
<label>Fields 3</label>
<input type="text" name="fields[fields3]"/>
<!-- other field (text, select, textarea, etc) -->
<label>Fields 19</label>
<input type="text" name="fields[fields19]"/>
<label>Fields 20</label>
<input type="text" name="fields[fields20]"/>
<input type="submit" value="submit" />
</form>

Simple Ajax Pagination With JQuery and Codeigniter

November 22nd, 2011 by aditia rahman / 13 Comments  

     

Codeigniter pagination class is really useful for me, it help to cut the repetitive task when we are creating pagination with large data, today I want to share a little of my thought, using codeigniter pagination class with ajax jquery. Here I show with a simple codeigniter code. This post only show the code example, cause i don’t think it necessary to provide a downloadable code.

codeigniter ajax pagination jquery

Controller

Here are the controller, to make it easier the data in this example using a static array variable, so it very easy for us to get the data by the array index, and we need to load the url helper and of course the pagination library.

Codeigniter Layout Library For Autoload Frequently Used Views

May 2nd, 2011 by aditia rahman / 13 Comments  

     

I came up with idea how to automatically load most used layout in Codeigniter, basically I came from CakePHP that automated all default layout, in this case we can call it views part of MVC, when creating codeingniter application usually I follow the documentation when load some views from controller, something like this code

$data['page_title'] = 'Your title';
$this->load->view('header');
$this->load->view('menu');
$this->load->view('content', $data);
$this->load->view('footer');

Or the worse before this sometimes I include the header and footer directly on the view file, well these method really wasting time, an make the code on the views not really well organized.

[Opinion] Why PHP Developers Choose CodeIgniter

March 28th, 2011 by aditia rahman / 11 Comments  

     

Codeigniter is one of the most popular php framework out there, that have been used by many php developers around the world. This post is just my own opinion from my technical experience while using codeigniter. This graphic below is taken from google trends to compare codeigniter search popularity, than any other popular php framework.

codeigniter, cakephp, zend framework, symfony google trend

The first php framework I use is cakephp, it has a lot more features than codeigniter, very detail documentation too, for the first time it will take some time to understanding, exploring the features and find some other reference online.

Extjs: Simple User Managament Using Codeigniter

December 9th, 2010 by aditia rahman / 14 Comments  

     

Hello again this is another post of ExtJS, this post is to showing my little idea how to manage user permission in ExtJS component, In this post I not showing the full source code, just a little part of the code to get the idea how it works, however the complete source code still available on the download link at the end of this post.

This example is a simple user management that user can manipulate other user data and users groups, user need to logged in to the system to do some action, and the feature are:

- Add, Update, Delete Users
- Add, Update, Delete Groups
- Administrator cannot be deleted or updated

Which mean it will take different action button in the application screen, depend on the users groups, what is not handled in this example is user restriction, if a group have granted to modify certain user, it can modify whole user although it is the administrator.

The image is the file structure that I have created on this example, there will be a form and two grid panel in this application, a usual login form with label and textfield, a grid contain user data with the toolbar menu and a grid contain group data.

In the database we need to make a relation between user and groups and here the sql code that I created, for both groups and users table

Drag and Drop Shopping Cart Using ExtJS and CodeIgniter Cart

August 21st, 2010 by aditia rahman / 10 Comments  

     

This is my other post about simple usage of ExtJS with CodeIgniter, this time I want to create a simple drag and drop shopping cart, I have learn about how to use the cart class in CodeIgniter that I have posted in the previous post, i’m using MySQL for the storing the product data. I prepared the mockup it something like this

Understanding CodeIgniter Cart Class

August 4th, 2010 by aditia rahman / 3 Comments  

     

CodeIgniter Cart ClassCart is one of the most important feature when creating an online store. In this post I want to have more understanding about Cart Class in CodeIgniter, cause maybe come in handy in the future, you can see how many new online store out there open in business, and in this internet age, online store seems the must have for many people who have retail business, in this post I’m not writing about how to use it in some example, the code I posted in here just copying from the original cart class documentation, but i’m included the link to the example usage of this class on the section 4 below.

Cropping Image To Square Dimension With CodeIgniter

July 14th, 2010 by aditia rahman / 11 Comments  

     

I’ve posted similar article before but this time I want to do it with codeigniter, codeigniter have a powerful image manipulation class, in this post I will use it to make thumbnail square from image, let get directly to the code. I make the function inside the controller, this code is cropping image that already located on the server so the image path (not URL) have to be defined.