PQuery Library for CodeIgniter

In this post, I will tell  you how to user PQuery Library in CodeIgniter. PQuery is one of usefull  library. Pquery is combination of  PHP and Jquery Library. You can see details of Pquery in http://www.ngcoders.com/php/pquery-php-and-jquery. To start Pquery in CodeIgniter, the things you have to do is :

1. Download the Pquery library from here.

2. extract zip file and copy the pquery.php file (in /pquery/pquery.php) into codeigniter library (in /system/application/libraries)

3. copy jquery.js (in /pquery/js/jquery.js) in your javascript application folder (ex : /system/application/js)

4. load the library from the controller :

class Login extends Controller {
function Login()
function index() {
function pquerytest() {
echo "This content is load by Pquery";

5.  in your views page (ex : test.php), you can see from this example :

<title>Pquery - CodeIgniter Test</title>
<script src="(your_js_directory)/jquery.js" type="text/javascript"></script>
<?=$this->pquery->link_to_remote("Ajax Link",array('url'=>base_url().'index.php/login/pquerytest','update'=>'#testdiv','success'=>'alert("Ajax was successfull");'));?>
<div id="testdiv">Update ME(Ajax Link w callaback)</div>

6. Finish.

You can see another class reference of Pquery from here.

For more information, please email me at sgt.wibowo@gmail.com

  1. PQuery itu apa ya ? library baru ya mas ?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: