Archive for the ‘ CodeIgniter ’ Category

Pre released SPIN alpha 2 (Countdown ….)

CountdownWaiting for pre released “Spin” alpha 2. Spin is PHP Web Crawler, build with CodeIgniter Framework and can support database : Mysql, Postgre, etc.

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 :

<?php
class Login extends Controller {
function Login()
{
parent::Controller();
$this->load->library('pquery');
}
function index() {
$this->load->view('test.php');
}
function pquerytest() {
echo "This content is load by Pquery";
}
}
?>

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

<html>
<head>
<title>Pquery - CodeIgniter Test</title>
<script src="(your_js_directory)/jquery.js" type="text/javascript"></script>
</head>
<body>
<?=$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>
</body>
</html>

6. Finish.

You can see another class reference of Pquery from here.

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