Skip to content

Instantly share code, notes, and snippets.

@ymhuang0808

ymhuang0808/admin.php

Last active Aug 29, 2015
Embed
What would you like to do?
controller/admin.php
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Base_Controller extends CI_Controller
{
public function index()
{
// ignore
$this->_render_view('admin_view', '狗寶');
}
public function g1()
{
$this->_render_view('g1_view', '大一');
}
private function _render_view($main_view, $title, $main_data = array())
{
$header = array('title' => $title . ' - Tabo', 'user_display_name' => $display_name, 'page' => $this->uri->segment(2));
$this->load->view('header_view', $header);
if (empty($main_data)) {
$this->load->view($main_view);
}
else {
$this->load->view($main_view, $main_data);
}
$this->load->view('footer_view');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.