本文整理匯總了PHP中Translator::getLanguage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Translator::getLanguage方法的具體用法?PHP Translator::getLanguage怎麽用?PHP Translator::getLanguage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Translator
的用法示例。
在下文中一共展示了Translator::getLanguage方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getOne
public static function getOne($id)
{
$data = array();
$sql = '
SELECT * FROM {{translator}}
WHERE id=' . $id . '
';
$item = DB::getRow($sql);
$sql = '
SELECT * FROM {{translator}}
WHERE parent=' . $item['id'] . '
';
$rows = DB::getALL($sql);
foreach (Translator::getLanguage() as $ii => $lang) {
if ($ii == 0) {
$data[$item['lang']] = $item;
} else {
foreach ($rows as $row) {
if ($row['lang'] == $lang['value']) {
$data[$row['lang']] = $row;
}
}
}
}
return $data;
}
示例2: foreach
<div class="jsScroll whiteOverflow sections_container">
<table class="sections_table jsMoveContainerTR" tab="<?php
echo Funcs::$uri[1];
?>
" page="<?php
echo $_GET['p'];
?>
">
<tr class="sections_table_caption_row jsMoveFixed">
<th class="sections_table_cell">
<div class="sections_table_caption-holder jsFixedY">
<span class="sections_table_caption">ID</span>
</div>
</th>
<?php
foreach (Translator::getLanguage() as $item) {
?>
<th class="sections_table_cell">
<div class="sections_table_caption-holder jsFixedY">
<span class="sections_table_caption"><?php
echo $item['name'];
?>
</span>
</div>
</th>
<?php
}
?>
<th class="sections_table_cell">
<div class="sections_table_caption-holder jsFixedY"></div>
</th>