1. Seraf Dos Santos
  2. codeigniter-qform-library

Overview

codeigniter-qform-library by Serafim Junior Dos Santos Fagundes Cyb3r Network

Version 1.0.4

MIT License

Copyright (c) 2010 Serafim Junior Dos Santos Fagundes Cyb3r Network

--------------------------------------------------------------------------------

codeigniter-qform-library is a companion library of codeigniter-xhtml-library a
CodeIgniter library for Strict XHTML 1.0 document generation.

The goal of codeigniter-qform-library is to ease form field generation which 
codeigniter-xhtml-library doesn't easily provide.

--------------------------------------------------------------------------------
Usage
=====

In the controller...
--------------------

Load the libraries.

	$this->load->library( 'xhtml' );
	$this->load->library( 'qform' );

In the view...
--------------

	# Create a <form> tag

	$form = $this->qform->form();

	$form->attr( 'action', '' );

	# Create a <input> text type field

		$name = 'myField';
		$value = '';
		$disabled = FALSE;

		$in_text = $this->form->text( $name, $value, $disabled );

	# Or a <textarea> field

		$name = 'manyLinesField';
		$value = 'Initial text...';
		$disabled = FALSE;
		$multiline = TRUE;
		$rows = 5;
		$cols = 10;

		$in_text = $this->form->text( $name, $value, $disabled, $multiline, $rows, $cols );
	
	$form->append( $in_text );

	# Append form to another $this->xhtml element
	...