eastside/application/controllers/gallery.php
Linus Miller cd141ef6fa Initial commit.
Former-commit-id: d2e17d67fe98124db4e87b10597af9d54d14d0de
2013-12-07 17:43:26 +01:00

26 lines
1014 B
PHP

<?php
class Gallery extends Default_Master_Controller {
public function __construct() {
parent::__construct();
$this->load->model('gallery_model');
$this->load->helper('html');
$this->load->helper('url');
}
public function index() {
$data['paintings'] = $this->gallery_model->get_paintings_active_all();
//$data['content'] = $this->load->view('gallery/index',$data,true);
//$data['title'] = 'Paintings';
//$data['current_page'] = 'gallery';
$this->master->write('current_page', 'gallery');
$this->master->write_view('content', 'gallery/index', $data);
$this->master->render();
}
public function view($id = 1) {
$data['p'] = $this->gallery_model->get_painting_by_id($id);
$this->master->write_view('content', 'gallery/view', $data);
$this->master->write('title', 'Painting : ' . $id);
$this->master->write('current_page', 'gallery');
$this->master->render();
}
}