当前位置: 首页>>代码示例>>PHP>>正文


PHP Translation::translations方法代码示例

本文整理汇总了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']);
开发者ID:pombredanne,项目名称:soundcomparisons,代码行数:31,代码来源:translation.php

示例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}>";
开发者ID:pombredanne,项目名称:soundcomparisons,代码行数:31,代码来源:overview.php


注:本文中的Translation::translations方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。