本文整理汇总了PHP中Translation::translations方法的典型用法代码示例。如果您正苦于以下问题:PHP Translation::translations方法的具体用法?PHP Translation::translations怎么用?PHP Translation::translations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Translation
的用法示例。
在下文中一共展示了Translation::translations方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/** Returns a JSON array of all Names in the Studies table. */
case 'studies':
echo Config::toJSON(Translation::studies());
break;
/**
Fetches the complete Page_Translations table.
@returns A JSON Array with JSON Objects inside.
Fields of contained JSON Objects are named as in db.
*/
/**
Fetches the complete Page_Translations table.
@returns A JSON Array with JSON Objects inside.
Fields of contained JSON Objects are named as in db.
*/
case 'translations':
echo Config::toJSON(Translation::translations());
break;
/**
@param $_GET['TranslationId']
@param $_GET['Payload'] The payload that determines what will be updated.
@param $_GET['Update'] The update value to write
@param $_GET['Provider'] The Provider to perform the update to
*/
/**
@param $_GET['TranslationId']
@param $_GET['Payload'] The payload that determines what will be updated.
@param $_GET['Update'] The update value to write
@param $_GET['Provider'] The Provider to perform the update to
*/
case 'update':
Translation::update($_GET['TranslationId'], $_GET['Payload'], $_GET['Update'], $_GET['Provider']);
示例2: function
<tbody>
<?php
$rfcLangs = Translation::getRfcLanguages();
$genRfcLangOptions = function ($rfcLang) use($rfcLangs) {
$sel = array_key_exists($rfcLang, $rfcLangs) ? '' : ' selected="selected"';
$opts = "<option class='default'{$sel} value='null'>none</option>";
foreach ($rfcLangs as $rfc => $sn) {
$sel = $rfc === $rfcLang ? ' selected="selected"' : '';
$opts .= "<option{$sel} value='{$rfc}'>{$sn}</option>";
}
return "<select>{$opts}</select>";
};
$genTextInput = function ($txt) {
return "<input type='text' value='{$txt}'>";
};
foreach (Translation::translations() as $t) {
//Fields to represent:
$tId = $t['TranslationId'];
$name = $t['TranslationName'];
$bm = $t['BrowserMatch'];
$img = $t['ImagePath'];
$rfcL = $t['RfcLanguage'];
$act = $t['Active'];
//Transformations:
$sLnk = "<a href='?action=translation&tId={$tId}' class='btn btn-info'>Translate</a>";
$dLnk = session_mayEdit() ? "<a href='query/translation.php?action=deleteTranslation&TranslationId={$tId}' class='btn btn-danger'>Delete</a>" : '';
$name = $genTextInput($name);
$bm = $genTextInput($bm);
$rfcL = $genRfcLangOptions($rfcL);
$chk = $act == 1 ? ' checked="checked"' : '';
$act = "<input type='checkbox'{$chk}>";