Created
July 9, 2011 10:35
-
-
Save arvindravi/1073495 to your computer and use it in GitHub Desktop.
My Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Post extends CI_Controller { | |
function __construct() | |
{ | |
parent::__construct(); | |
$this->load->helper('form'); | |
$this->load->helper('url'); | |
$this->load->helper('html'); | |
$this->load->model('retindpost','dis'); | |
} | |
public function index() | |
{ | |
$this->load->view('postit'); | |
} | |
public function post_comment() | |
{ | |
$cmt=$this->input->post('cmt'); | |
$this->load->model('commentprocess'); | |
$now['show']=$this->commentprocess->insert_comment($cmt); | |
$this->load->view('commentland',$now); | |
} | |
public function ret_post() | |
{ | |
$data['id']=$this->uri->segment(3); | |
$dpost['dp']=$this->dis->ret_ind_post($data['id']); | |
$comments['return']=$this->dis->get_comments(); | |
$data1=$dpost + $comments; | |
$this->load->view('indpostview',$data1); | |
} | |
public function boo() | |
{ | |
$this->load->database(); | |
$ret="SELECT * FROM posts ORDER BY 1 DESC LIMIT 1"; | |
$query=$this->db->query($ret); | |
$doo['fed']=$query->result(); | |
$this->load->view('landing1',$doo); | |
} | |
public function foo() | |
{ | |
$this->load->database(); | |
$mpost=$_POST['post']; | |
$sql="INSERT INTO posts VALUES ('',".$this->db->escape($mpost).")"; | |
$this->db->query($sql); | |
$this->load->view('landing'); | |
} | |
public function view() | |
{ | |
$this->load->model('returnposts','post'); | |
$data['posts']=$this->post->get_all_posts(); | |
$this->load->view('viewit',$data); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment