Update base.php
This commit is contained in:
parent
5daed67f0d
commit
0f9f37ab11
|
@ -1,5 +1,29 @@
|
||||||
<?php
|
<?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) {
|
function array_key_empty($key, $array) {
|
||||||
$empty = true;
|
$empty = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user