load() 정적인 공개 메소드

Loads content from a passed file
static public load ( string $file, boolean $return = true ) : mixed
$file string The path to the file
$return boolean True: return the content of the file, false: echo the content
리턴 mixed
예제 #1
0
 function js()
 {
     $output = array();
     $output[] = '<script type="text/javascript">';
     foreach ($this->js as $file) {
         $output[] = content::load($file) . "\n";
     }
     $output[] = '</script>';
     return implode("\n", $output);
 }
예제 #2
0
파일: index.php 프로젝트: studio-404/404
function __autoload($class_name)
{
    $class_load = false;
    if (file_exists('functions/' . $class_name . '.php')) {
        // auto load function
        @(include 'functions/' . $class_name . '.php');
        $class_load = true;
    }
    if (!$class_load) {
        echo "Class: <b>" . $class_name . "</b> can't load..";
        exit;
    }
}
?>
<!DOCTYPE html>
<html lang="ge">
<head>
	<meta charset="utf-8" />
	<title>Invoices</title>
</head>
<body>
	<a href="?page=welcome">Invoices</a> | 
	<a href="?page=csv">CSV</a> <br /><br />
<?php 
$page = isset($_GET['page']) && !empty($_GET['page']) ? $_GET['page'] : "welcome";
$content = new content();
$content->load($page);
?>
</body>
</html>