/home/hdwebsolution/www/sareenn/application/controllers/Blog.php
<?php
class Blog extends CI_Controller {
    public function index() {
        
    
   
        $this->load->model('Blog_model');
        $data['posts'] = $this->Blog_model->get_posts();
         // Debugging output
       
        
        
        $this->load->view('blog/index', $data);
    }

   public function view($blog_name) {
    $this->load->model('Blog_model');
    $data['post'] = $this->Blog_model->get_post_by_name($blog_name); // Update the model method accordingly
    $this->load->view('blog/view', $data);
}


    // Add functions for creating, editing, and deleting posts here
}