本文整理汇总了PHP中rootPath函数的典型用法代码示例。如果您正苦于以下问题:PHP rootPath函数的具体用法?PHP rootPath怎么用?PHP rootPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rootPath函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: chapmenu
function chapmenu($depth)
{
$lang = $GLOBALS["settings"]->getLang();
$chapmenu_xml = rootPath($depth) . "locale/{$lang}/locale.xml";
$chapmenu_xsl = rootPath($depth) . "xsl/chapmenu.xsl";
return xslt2($chapmenu_xml, $chapmenu_xsl);
}
示例2: render
public static function render($viewFile, $data)
{
foreach ($data as $k => $d) {
${$k} = $d;
}
include rootPath() . "/App/Views/" . $viewFile;
}
示例3: redirect
function redirect($location, $debug = 0)
{
$nextLocation = rootPath() . $location;
if ($debug) {
dump($_SESSION, "SESSION");
echo "<br />Manually redirect to <a href=" . $nextLocation . " \"title=\"index\">" . $nextLocation . "</a>";
} else {
header("Location: " . $nextLocation);
}
}
示例4: extractParams
function extractParams(&$text)
{
$vars = array('template' => 'default', 'root' => rootPath());
$lines = explode("\n", $text);
$res = array();
foreach ($lines as $line) {
$matches = array();
if (preg_match('/^\\s*\\<\\!\\-\\-\\?([a-z]+)\\s+(.*)\\-\\-\\>\\s*$/', $line, $matches)) {
$vars[$matches[1]] = $matches[2];
continue;
}
$res[] = $line;
}
$text = implode("\n", $res);
return $vars;
}
示例5: alert
function alert($message, $type = "Notice")
{
?>
<div id="<?php
echo $type;
?>
" onclick="hide(this)">
<div class="alert_icon">
<img src="<?php
echo rootPath("views/icons/" . $type . ".png");
?>
" alt="Alert icon" height="24" />
</div>
<div class="alert_content"><?php
echo "<b>" . $type . " message:</b> <pre class=\"alert\">" . (!empty($message) ? $message : "alerts.php: Empty message!") . "</pre>";
?>
</div>
</div>
<?php
}
示例6: __construct
public function __construct()
{
$this->setTheme(Config::get('view.theme'));
$this->setViewPath(rootPath() . 'themes/' . $this->getTheme() . '/');
}
示例7: validationForm
</td>
</tr>
<tr style="<?php
echo $tipo == 'X' ? '' : 'display:none';
?>
">
<td>
<label for="ipt_Habilitacoes">Habilitações:</label>
</td>
<td colspan="3">
<input type="text" id="ipt_Habilitacoes" name="habilitacoes" value="<?php
echo $habilitacoes;
?>
" />
<span id="validatorHabilitacoes" class="validatorField" title="As habilitações são de preenchimento obrigatório!">*</span>
</td>
</tr>
</table>
<input type="submit" name="save" value="Guardar" onclick="return validationForm();" />
<?php
if (!$isToRemove) {
?>
<input type="submit" name="delete" value="Remover" />
<?php
}
?>
<input type="button" value="Cancelar" onclick="window.location = 'index.php';" />
</form>
<?php
include rootPath('includes/master_footer.php', 1);
示例8: log_message
/**
* 打印日志
* @param type $message
* @return boolean
*/
function log_message($message)
{
if (empty($message)) {
return false;
}
$log_path = config('logs.path', 'var/logs/');
if ($log_path == 'var/logs/') {
$path = rootPath() . $log_path . date('Y-m-d') . '.log';
} else {
$path = $log_path . date('Y-m-d') . '.log';
}
return error_log(date('H:i:s ') . getenv('REMOTE_ADDR') . " {$message}\r\n", 3, $path);
}
示例9: __construct
public function __construct()
{
$this->logPath = rootPath() . 'var/logs/';
}
示例10: rootPath
</ul>
<?php
} else {
?>
<div class="login">
<form action="/pw606/myacount/authenticate.php?url=<?php
echo $_SERVER['SCRIPT_NAME'];
?>
" method="post">
<label for="txtuser">Username: </label>
<input id="txtuser" type="text" name="user"/>
<label for="txtpassword">Password: </label>
<input id="txtpassword" type="password" name="password"/>
<input type="submit" value="Login">
<a id="login_a" href="<?php
echo rootPath("public/register.php", 1);
?>
">Registar</a>
</form>
</div>
<?php
}
?>
</li>
</ul>
</div>
<div id="css-color">
<div id="css-color-select">
<div class="css-blue">
<a href="#" class="switchCss" title="Tema azul" rel="blue.css" >CSS Blue</a>
</div>
示例11: header
if (strpos($_SERVER['SCRIPT_NAME'], '/co/') !== false) {
$perfil = "co";
} else {
if (strpos($_SERVER['SCRIPT_NAME'], '/rd/') !== false) {
$perfil = "rd";
} else {
$perfil = "";
}
}
// Caso um utilizador autenticado entre numa área que não é a sua, faz logout automaticamente.
if ($user_authenticated && $perfil == 'co' && !$user_isAdmin) {
header("location: " . rootPath("co/logout.php", 1));
exit(0);
} else {
if ($user_authenticated && $perfil == 'rd' && $user_isAdmin) {
header("location: " . rootPath("rd/logout.php", 1));
exit(0);
}
}
// Variáveis auxiliares para os relógios
$jo_Date = new TimeStamp(new DateTime("now"), joInitialDate());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>GIJO</title>
<link rel="shortcut icon" href="/pw606/favicon.ico">
<meta http-equiv="content-type" content="text/html" charset="ISO-8859-1" />
<link href="/pw606/css/default_gijo.css" rel="stylesheet" type="text/css" />
<link href="/pw606/css/<?php
echo $perfil == 'rd' ? 'rd' : 'co';
示例12: showError
/**
* 显示错误
*
* @static
* @access public
* @param string $type 错误类型 db,system
* @param string $errorMsg
* @param string $phpMsg
*/
public static function showError($type, $errorMsg, $phpMsg = '')
{
$errorMsg = str_replace(rootPath(), '', $errorMsg);
ob_end_clean();
$host = $_SERVER['HTTP_HOST'];
$title = $type == 'db' ? 'Database' : 'System';
echo <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>{$host} - {$title} Error</title>
<meta http-equiv="Content-Type" content="text/html; charset={$_G['config']['output']['charset']}" />
<meta name="ROBOTS" content="NOINDEX,NOFOLLOW,NOARCHIVE" />
<style type="text/css">
<!--
body { background-color: white; color: black; font: 9pt/11pt verdana, arial, sans-serif;}
#container {margin: 10px;}
#message {width: 1024px; color: black;}
.red {color: red;}
a:link {font: 9pt/11pt verdana, arial, sans-serif; color: red;}
a:visited {font: 9pt/11pt verdana, arial, sans-serif; color: #4e4e4e;}
h1 {color: #FF0000; font: 18pt "Verdana"; margin-bottom: 0.5em;}
.bg1 {background-color: #FFFFCC;}
.rowTitle {background-color: #EEEEEE;}
.table {background: #AAAAAA; font: 11pt Menlo,Consolas,"Lucida Console"}
.info {
background: none repeat scroll 0 0 #F3F3F3;
border: 0px solid #aaaaaa;
border-radius: 10px 10px 10px 10px;
color: #000000;
font-size: 11pt;
line-height: 160%;
margin-bottom: 1em;
padding: 1em;
}
.help {
background: #F3F3F3;
border-radius: 10px 10px 10px 10px;
font: 12px verdana, arial, sans-serif;
text-align: center;
line-height: 160%;
padding: 1em;
}
.sql {
background: none repeat scroll 0 0 #FFFFCC;
border: 1px solid #aaaaaa;
color: #000000;
font: arial, sans-serif;
font-size: 9pt;
line-height: 160%;
margin-top: 1em;
padding: 4px;
}
-->
</style>
</head>
<body>
<div id="container">
<h1>{$title} Error</h1>
<div class='info'>{$errorMsg}</div>
EOT;
if (!empty($phpMsg)) {
echo '<div class="info">';
echo '<p><strong>PHP Debug</strong></p>';
echo '<table cellpadding="5" cellspacing="1" width="100%" class="table"><tbody>';
if (is_array($phpMsg)) {
echo '<tr class="rowTitle"><td>No.</td><td>File</td><td>Line</td><td>Code</td></tr>';
foreach ($phpMsg as $k => $msg) {
$k++;
echo '<tr class="bg1">';
echo '<td>' . $k . '</td>';
echo '<td>' . $msg['file'] . '</td>';
echo '<td>' . $msg['line'] . '</td>';
echo '<td>' . $msg['function'] . '</td>';
echo '</tr>';
}
} else {
echo '<tr><td><ul>' . $phpMsg . '</ul></td></tr>';
}
echo '</tbody></table></div>';
}
echo <<<EOT
</div>
</body>
</html>
EOT;
exit;
}
示例13: date
<div id="footer">
<div class="relogio">
<span id="clockHH"><?php
echo date("H") - 1;
?>
</span>:<span id="clockmm"><?php
echo date("i");
?>
</span>:<span id="clockss"><?php
echo date("s");
?>
</span>
<ul>
<li>
<a href="<?php
echo rootPath('public/contacts.php', 1);
?>
" id="relogio">Contactos</a>
</li>
<li>
<a href="/pw606/rd/index.php" id="relogio">Responsável da Delegação</a>
</li>
<li>
<a href="/pw606/co/index.php">Comité Olimpico</a>
</li>
</ul>
</div>
<div class="copyright">
PW606 ® 2011 TODOS OS DIREITOS RESERVADOS.
</div>
</div>
示例14: rootPath
<?php
$root = rootPath();
?>
<!DOCTYPE html>
<html>
<head>
<title>Contacts</title>
<meta charset="UTF-8">
<link rel="shortcut icon" href="<?php
echo $root;
?>
views/icons/group44.png" type="image/png">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<link rel="stylesheet" type="text/css" href="<?php
echo $root;
?>
views/css/style.css">
<link rel="stylesheet" type="text/css" href="<?php
echo $root;
?>
views/css/alerts.css">
<link rel="stylesheet" type="text/css" href="<?php
echo $root;
?>
views/css/debug.css">
<link rel="stylesheet" type="text/css" href="<?php
echo $root;
?>
views/css/head.css">
示例15: header
<?php
if (!isset($_SESSION['login'])) {
header("location: " . rootPath("co/index.php", 1));
}