當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Translator::run方法代碼示例

本文整理匯總了PHP中Translator::run方法的典型用法代碼示例。如果您正苦於以下問題:PHP Translator::run方法的具體用法?PHP Translator::run怎麽用?PHP Translator::run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Translator的用法示例。


在下文中一共展示了Translator::run方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 public function run()
 {
     $this->input = filter_input(INPUT_POST, 'english', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
     if (isset($this->input)) {
         $lexer = new Lexer($this->input);
         $tokens = $lexer->run();
         $translator = new Translator($tokens);
         $result = $translator->run();
         if ($this->isAjax()) {
             $this->sendPayload($result);
         }
     }
 }
開發者ID:martinsifra,項目名稱:PigLatin,代碼行數:13,代碼來源:Driver.php

示例2: translate_request

<?php

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once 'abstract_translator.php';
class Translator extends AbstractTranslator
{
    protected function translate_request($request)
    {
        $request = json_decode($request, true);
        var_dump($request);
        $formatted_request = array();
        $formatted_request['ssn'] = implode('', explode('-', $request['ssn']));
        $formatted_request['creditScore'] = $request['credit_score'];
        $formatted_request['loanAmount'] = $request['amount'];
        $formatted_request['loanDuration'] = $request['duration'];
        var_dump($formatted_request);
        return json_encode($formatted_request);
    }
}
$translator_params = array('host' => 'localhost', 'port' => '5672', 'username' => 'test', 'password' => 'test', 'routing_key' => '22222222');
$bank_params = array('host' => 'localhost', 'port' => '5672', 'username' => 'test', 'password' => 'test', 'exchange' => 'bank_not_nordea', 'reply_to' => 'vongrad_not_nordea');
$translator = new Translator($translator_params, $bank_params);
$translator->run();
開發者ID:vongrad,項目名稱:loanbroker,代碼行數:25,代碼來源:translator.php

示例3: Translator

<table>
<tr>
    <th>Directory</th>
    <td><input name="newdir"></td>
</tr>
<tr>
    <th>Language</th>
    <td><input name='language'></td>
</tr>
<tr>
    <th>Author</th>
    <td><input name='author'></td>
</tr>
<tr>
    <th>URL</th>
    <td><input name='url'></td>
</tr>
</table>
<input type='submit' name='save' value='Submit'>
<input type='reset'>
</form>
<?php 
        }
        if (!defined("EMBEDDED")) {
            SB_Page::foot();
        }
    }
}
$tr = new Translator();
$tr->run();
開發者ID:codeministry,項目名稱:sitebar,代碼行數:30,代碼來源:translator.php


注:本文中的Translator::run方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。