本文整理匯總了PHP中lang::javascript方法的典型用法代碼示例。如果您正苦於以下問題:PHP lang::javascript方法的具體用法?PHP lang::javascript怎麽用?PHP lang::javascript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類lang
的用法示例。
在下文中一共展示了lang::javascript方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: extract_dir
error_reporting(E_ALL);
define('SCRIPTNAME', 'lang2js');
define('VISCACHA_CORE', '1');
include '../data/config.inc.php';
function extract_dir($source, $realpath = true)
{
if ($realpath) {
$source = realpath($source);
} else {
$source = rtrim($source, '/\\');
}
$pos = strrpos($source, '/');
if ($pos === false) {
$pos = strrpos($source, '\\');
}
if ($pos > 0) {
$dest = substr($source, 0, $pos + 1);
} else {
$dest = '';
}
return $dest;
}
include '../classes/class.language.php';
header('Content-type: text/javascript');
if (!empty($_REQUEST['id'])) {
$id = intval(trim($_REQUEST['id'] + 0));
$lang = new lang($id);
$lang->javascript();
} else {
echo 'alert("Could not load language file for javascript without id!");';
}
示例2: intval
<?php
error_reporting(E_ALL);
define('SCRIPTNAME', 'lang2js');
define('VISCACHA_CORE', '1');
include '../data/config.inc.php';
include '../classes/function.phpcore.php';
include '../classes/class.language.php';
header('Content-type: text/javascript');
if (!empty($_REQUEST['id'])) {
$id = intval(trim($_REQUEST['id'] + 0));
$lang = new lang($id);
$file = !empty($_REQUEST['admin']) ? 'admin/javascript' : 'javascript';
$lang->javascript($file);
} else {
echo 'alert("Could not load language file for javascript without id!");';
}