本文整理汇总了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);
}
}
}
示例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();
示例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();