jigniter™

jQuery & CodeIgniter – Perfect combination for web application

Archive for the ‘form’ tag

Simple Form Generation in CodeIgniter

with 7 comments

If you are using CodeIgniter, as well as any other PHP framework, you may notice that building CRUD forms is one of the most bother and routine tasks. Probably 80% of general web applications uses CRUD (create/read/update/delete).

In CodeIgniter, you can use any of the form generation libraries.

One of my preferred libraries is Form Generation Library by Frank Michel (see @macigniter’s thread here). It allows you to create clean XHTML forms with CodeIgniter. See demo here.

Using Form Generation Library

So, in order to use this library, you need to download it from here (library files only is enough if you don’t want the entire site structure).

Read the rest of this entry »

Written byadmin

August 2nd, 2009 at 6:30 pm

Posted inTutorials

Tagged with , ,

How to submit a page to the same controller in CodeIgniter

with 2 comments

Imagine you have a view with a <FORM> that need to submit to the same controller class. Probably you don’t want to hardcode the action attribute of your form nor leaving it in blank.

Using PHP_SELF could be a possible approach. However, since $_SERVER[‘PHP_SELF’] is a PHP server variable (nothing to do with CodeIgniter), you may encounter some problems with different environments.

So, why not to use the built-in CodeIgniter URI library? My solution to this problem is the following. Use $this->uri->uri_string() in conjunction with site_url().

Here is a simple example:



Written byadmin

July 17th, 2009 at 11:23 am

Posted inSnippets Ideas

Tagged with ,