Update base.php

This commit is contained in:
Namhyeon Go 2018-01-01 03:31:02 +09:00 committed by GitHub
parent 5daed67f0d
commit 0f9f37ab11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,29 @@
<?php
if(function_exists('array_key_empty')) {
// view render
if(!function_exists('renderView')) {
function renderView($name, $data=array()) {
if(count($data) > 0) {
extract($data);
}
$viewfile = './view/' . $name . '.php';
if(file_exists($viewfile)) {
include($viewfile);
}
}
}
// load helper
if(!function_exists('loadHelper')) {
function loadHelper($name) {
$helperfile = './helper/' . $name . '.php';
if(file_exists($helperfile)) {
include($helperfile);
}
}
}
if(!function_exists('array_key_empty')) {
function array_key_empty($key, $array) {
$empty = true;