|
楼主 |
发表于 2012-1-12 11:05:20
|
显示全部楼层
贴上代码,是看视频 20分钟blog的,完全一样的<?php
class Blog extends CI_Controller {
function Blog()
{
parent::Controller();
$this->load->helper('url');
$this->load->helper('form');
}
public function index()
{
//$this->load->view('welcome_message');
$data['title']="My blog title";
$data['heading']="My blog heading";
$data['query']=$this->db->get('entries');
$this->load->view('blog_view',$data);
}
function comments()
{
$data['title']="My Comment Title222";
$data['heading']="My Comment Heading222";
$this->load->view('comment_view',$data);
}
function comment_insert()
{
$this->db->insert('comments',$_post);
redirect('blog/comments/'.$_POST['entry_id']);
}
}
?>
|
|