本文整理匯總了PHP中TPage::getLoadedJS方法的典型用法代碼示例。如果您正苦於以下問題:PHP TPage::getLoadedJS方法的具體用法?PHP TPage::getLoadedJS怎麽用?PHP TPage::getLoadedJS使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TPage
的用法示例。
在下文中一共展示了TPage::getLoadedJS方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
public static function run($debug = FALSE)
{
$class = isset($_REQUEST['class']) ? $_REQUEST['class'] : '';
$static = isset($_REQUEST['static']) ? $_REQUEST['static'] : '';
$method = isset($_REQUEST['method']) ? $_REQUEST['method'] : '';
$content = '';
set_error_handler(array('TCoreApplication', 'errorHandler'));
if (class_exists($class)) {
if ($static) {
$rf = new ReflectionMethod($class, $method);
if ($rf->isStatic()) {
call_user_func(array($class, $method), $_REQUEST);
} else {
call_user_func(array(new $class(), $method), $_REQUEST);
}
} else {
try {
$page = new $class($_GET);
ob_start();
$page->show($_GET);
$content = ob_get_contents();
ob_end_clean();
} catch (Exception $e) {
ob_start();
if ($debug) {
new TExceptionView($e);
$content = ob_get_contents();
} else {
new TMessage('error', $e->getMessage());
$content = ob_get_contents();
}
ob_end_clean();
}
}
} else {
if (function_exists($method)) {
call_user_func($method, $_REQUEST);
} else {
new TMessage('error', "<b>Error</b>: class <b><i><u>{$class}</u></i></b> not found");
}
}
if (!$static) {
echo TPage::getLoadedCSS();
}
echo TPage::getLoadedJS();
echo $content;
}
示例2: run
public static function run($debug = FALSE)
{
new TSession();
$lang = TSession::getValue('language') ? TSession::getValue('language') : 'en';
TAdiantiCoreTranslator::setLanguage($lang);
TApplicationTranslator::setLanguage($lang);
if ($_REQUEST) {
$class = isset($_REQUEST['class']) ? $_REQUEST['class'] : '';
if (!TSession::getValue('logged') and $class !== 'LoginForm') {
echo TPage::getLoadedCSS();
echo TPage::getLoadedJS();
new TMessage('error', 'Not logged');
return;
}
parent::run($debug);
}
}
示例3: TSession
require_once 'init.php';
$theme = 'frontend';
new TSession();
if (TSession::getValue('logged')) {
$content = file_get_contents("app/templates/{$theme}/layoutManual.html");
} else {
$content = file_get_contents("app/templates/{$theme}/login.html");
}
$content = str_replace('{LIBRARIES}', file_get_contents("app/templates/{$theme}/libraries.html"), $content);
$content = str_replace('{class}', isset($_REQUEST['class']) ? $_REQUEST['class'] : '', $content);
$content = str_replace('{template}', $theme, $content);
$content = str_replace('{username}', TSession::getValue('username'), $content);
$content = str_replace('{frontpage}', TSession::getValue('frontpage'), $content);
$content = str_replace('{query_string}', $_SERVER["QUERY_STRING"], $content);
$css = TPage::getLoadedCSS();
$js = TPage::getLoadedJS();
$content = str_replace('{HEAD}', $css . $js, $content);
if (isset($_REQUEST['changeContent'])) {
$contenToChange = $_REQUEST['changeContent'];
switch ($contenToChange) {
case 'clients':
$insideContent = file_get_contents("app/resources/manual/clients.html");
break;
case 'calendar':
$insideContent = file_get_contents("app/resources/manual/calendar.html");
break;
case 'notes':
$insideContent = file_get_contents("app/resources/manual/notes.html");
break;
case 'stock':
$insideContent = file_get_contents("app/resources/manual/stock.html");