-
Notifications
You must be signed in to change notification settings - Fork 0
/
function.php
48 lines (40 loc) · 844 Bytes
/
function.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
function C($name, $method)
{
require_once('/libs/Controller/'.$name.'Controller.class.php');
$classname = $name.'Controller';
$obj = new $classname();
$obj->$method();
}
function M($name)
{
require_once('/libs/Model/'.$name.'Model.class.php');
$classname = $name.'Model';
$obj = new $classname();
return $obj;
}
function V($name)
{
require_once('/libs/View/'.$name.'View.class.php');
$classname = $name.'View';
$obj = new $classname();
return $obj;
}
function ORG($path, $name, $params=array())
{
require_once('libs/ORG/'.$path.$name.'.class.php');
$obj = new $name();
if(!empty($params))
{
foreach($params as $key=>$value)
{
$obj->$key = $value;
}
}
return $obj;
}
function daddslashes($str)
{
return (!get_magic_quotes_gpc())?addslashes($str):$str;
}
?>