Archive for the ‘ Library ’ Category

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 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