示例#1
0
 /**
  * Add variables to view
  *
  * @param	array|string	$names
  * @param	string	$value
  * @return	void
  */
 public function set($names, $value = null)
 {
     if (is_array($names)) {
         self::$_vars = array_merge(self::$_vars, $names);
     } else {
         self::$_vars[$names] = $value;
     }
 }
示例#2
0
文件: index.php 项目: vslko/mmvc
 */
// ========== PREPARE =========
error_reporting(E_ALL);
session_start();
if (version_compare(PHP_VERSION, '5.0.0', '<')) {
    exit("Sorry, MantellaMVC needs PHP version 5+!\n");
}
// ========== ROUTING =========
// MOD_REWRITE please configure via .htaccess or httpd.conf
// ========== SYSTEM INCLUDES ==========
@set_include_path(get_include_path() . PATH_SEPARATOR . "../app/config/");
require_once '../core/MantellaConfig.php';
require_once '../core/MantellaApplication.php';
require_once '../core/MantellaDBManager.php';
// ========== INITIAL CONFIGURATION ==========
CONF::init("../app/config.ini", dirname(__FILE__) . '/../');
// ========== INIT APPLICATION ==========
$app = new MantellaApplication('Index', '_');
try {
    $app->run();
} catch (Exception $e) {
    $e->logException();
    header($e->getHttpHeader());
    MantellaView::template("errors/" . $e->getCode());
    if (MantellaView::is_template_attached()) {
        MantellaView::set('error', $e->getFullError());
        MantellaView::show();
    } else {
        print "<div style=\"margin:100px; padding:30px; border:1px dotted #C0C0C0;\">\n        \t     ERROR " . $e->getCode() . ": " . $e->getHttpCause() . "</b><br /><br />\n            \t <span style=\"font-size:11px; font-family:Arial; color:#777;\">\n                \t  &gt;&gt; Url: " . $_SERVER["SERVER_NAME"] . $_SERVER['REQUEST_URI'] . "<br >\n\t\t   \t   \t\t  &gt;&gt; Ref. Number: " . $e->getRef() . "<br />\n\t\t       \t\t  &gt;&gt; Please inform " . (defined('M_ADMIN_EMAIL') ? "<a style=\"color:#666;\" href=\"mailto: " . M_ADMIN_EMAIL . "\">administrator</a>" : "administrator") . " about this problem, thanks!\n\t\t     \t</span>\n\t\t   \t  </div>\n";
    }
}