Posterous theme by Cory Watilo

Filed under: apiwork

facebook on apiwork

Today, I tried to combine with facebook and apiwork. Great!! it's not too hard. Now, I can call facebook class easily and apiwork can use facebook developer wiki. I just use Facebook Class for my apiwork. In Controller (facebook.php)
<?php
class facebookController extends Controller {

function facebookController()
{
parent::Controller();
}

function index()
{
$this->load->Facebook();
$data['fb_user']=$this->fb->get_loggedin_user();
$data['appapikey']=AWConfig::fbapikey;
$data['fb']=$this->fb;
$this->load->view("facebook_test",$data);
}
}
?>

Read the rest of this post »

Add jquery built in apiwork

haha. I add jquery for default. Here, I use in my view like this

<html> 
<head> 
<?php 
/* add script from code.jquery.com $this->jq->get_latest(); */
 //you can also load like this $this->load->js('jquery');
$this->jq->noconfilt=true //for jquery no conflit 
$this->jq->get_script(); 
?> 
<script> 
<?php $this->jq->start_jq(); ?> 
 alert("I'm jquery"); 
 <?php $this->jq->end_jq(); ?>
</script> 
</head> 
<body>  </body> 
</html> 

Done MVC

Today, I done my MVC framework raw, not include library file. Just call Controller -> Model -> View I told about my controller in yesterday. Here my view design
class simpleModel extends Model {

function simpleModel()
{
parent::Model();
}
function printit()
{
$data['a']=1;
$this->load->view("Test",$data);
}
}

Read the rest of this post »

load model look like CI

Abstract class Controller extends Loader {
public $load;
function Controller()
{
        $this->load=$this;
}
abstract function index();
}

So, I can call like this

class IndexController extends Controller {


    function IndexController()
    {
        parent::Controller();
    }

        function index()
        {
                $this->load->model("simple");
                print_r($this->simple);
        }
}

This is my first time setting look like this and I never thinking before

$this->load=$this ;

In the old, I calling like this

$this->load->simple->function();

hmm... How stupid it!!! Cheer!!!! Saturngod