Last active
August 29, 2015 14:05
-
-
Save ymhuang0808/b0c23c27a749b29227a8 to your computer and use it in GitHub Desktop.
controller/admin.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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