Skip to content

Instantly share code, notes, and snippets.

@cwicaksono
Last active January 15, 2020 12:24
Show Gist options
  • Save cwicaksono/9ae3725153dde2031b89324f8c5b7317 to your computer and use it in GitHub Desktop.
Save cwicaksono/9ae3725153dde2031b89324f8c5b7317 to your computer and use it in GitHub Desktop.
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('blogpost_model');
$this->load->model('categories_model');
}
public function index()
{
$data = array(
'posts' => $this->blogpost_model->getHome(),
'categories' => $this->categories_model->getAll()
);
$this->load->view('blog', $data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment