Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #8 from Dinesh-Ramakrishnan/master
Browse files Browse the repository at this point in the history
Fontawesome and Response Format
  • Loading branch information
vesparny committed Mar 10, 2013
2 parents cde43b9 + c9bad4d commit 056fd22
Show file tree
Hide file tree
Showing 20 changed files with 1,496 additions and 4 deletions.
11 changes: 9 additions & 2 deletions application/controllers/home.php
Expand Up @@ -2,15 +2,22 @@

class Home extends MY_Controller {

public function index(){
public function index($renderData=""){

/*
*set up title and keywords (if not the default in custom.php config file will be set)
*/


$this->title = "Yaaaaa";
$this->keywords = "arny, arnodo";

$this->_render('pages/home');
// 1. when you pass AJAX to renderData it will generate only that particular PAGE skipping other parts like header, nav bar,etc.,
// this can be used for AJAX Responses
// 2. when you pass JSON , then the response will be json object of $this->data. This can be used for JSON Responses to AJAX Calls.
// 3. By default full page will be rendered

$this->_render('pages/home',$renderData);
}

}
14 changes: 12 additions & 2 deletions application/core/MY_Controller.php
Expand Up @@ -32,7 +32,16 @@ function __construct()
}


protected function _render($view) {
protected function _render($view,$renderData="FULLPAGE") {
switch ($renderData) {
case "AJAX" :
$this->load->view($view,$this->data);
break;
case "JSON" :
echo json_encode($this->data);
break;
case "FULLPAGE" :
default :
//static
$toTpl["javascript"] = $this->javascript;
$toTpl["css"] = $this->css;
Expand Down Expand Up @@ -63,6 +72,7 @@ protected function _render($view) {

//render view
$this->load->view("template/skeleton",$toTpl);

break;
}
}
}
22 changes: 22 additions & 0 deletions resources/css/font-awesome-ie7.min.css

Large diffs are not rendered by default.

0 comments on commit 056fd22

Please sign in to comment.