本文整理匯總了PHP中i18n::get_instance方法的典型用法代碼示例。如果您正苦於以下問題:PHP i18n::get_instance方法的具體用法?PHP i18n::get_instance怎麽用?PHP i18n::get_instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類i18n
的用法示例。
在下文中一共展示了i18n::get_instance方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_request
protected function get_request()
{
$valid_params = array('lang', 'rev', 'reset', 'send', 'send_campaign', 'send_test', 'production', 'get_subscriber_count', 'update_send_time', 'update_cache', 'price', 'upload', 'split');
if (is_array($_GET)) {
if (array_key_exists('campaignName', $_GET)) {
echo $this->config['campaign_name_human_readable'];
exit;
}
if (array_key_exists('campaignSubject', $_GET)) {
$domain = isset($_GET['lang']) ? $_GET['lang'] : 'en';
echo _e(array('text' => 'title', 'section' => 'html_title', 'domain' => strtoupper($domain)));
exit;
}
if (array_key_exists('campaignFolder', $_GET)) {
$edm = new MC_edm($this->config);
echo basename($edm->get_cdn_location());
exit;
}
if (array_key_exists('campaignSchedule', $_GET)) {
$this->simple_campaign_table('EN', 'test');
}
if (array_key_exists('lang', $_GET)) {
$get_lang = strtoupper($_GET['lang']);
if (in_array($get_lang, $this->config['languages'])) {
$lang = i18n::get_instance();
$lang->set_domain($get_lang);
}
} else {
$get_lang = 'EN';
}
if (array_key_exists('rev', $_GET)) {
$this->mc_edm = new MC_edm($this->config);
$this->mc_edm->increment_all_image_filenames();
}
if (array_key_exists('reset', $_GET)) {
$this->mc_edm = new MC_edm($this->config);
$this->mc_edm->reset_all_filenames();
}
if (array_key_exists('send', $_GET)) {
$lang = $get_lang ? $get_lang : 'EN';
$sendto = $_GET['send'] == '' ? 'test' : $_GET['send'];
$this->create_campaign($lang, $sendto);
}
// if ( array_key_exists( 'test', $_GET ) ) {
// $lang = $get_lang ? $get_lang : 'EN';
// $this->mc_edm = new MC_edm( $this->config );
// $html = $this->get_file( $this->host . "?lang={$lang}&production" );
// $this->mc_edm->send_test_mail( $html );
// }
if (array_key_exists('get_subscriber_count', $_GET)) {
$this->get_subscriber_count();
}
if (array_key_exists('update_send_time', $_GET)) {
$this->update_send_time();
}
if (array_key_exists('send_campaign', $_GET)) {
$this->send_campaign();
}
if (array_key_exists('send_test', $_GET)) {
$this->send_test();
}
if (array_key_exists('update_cache', $_GET)) {
$this->update_cache();
}
if (array_key_exists('price', $_GET)) {
$this->generate_prices();
}
if (array_key_exists('upload', $_GET)) {
$this->mc_edm = new MC_edm($this->config);
$this->upload_image_dir();
}
foreach ($_GET as $key => $value) {
if (!in_array($key, $valid_params)) {
echo 'EXIT - ' . $key . " is not a valid parameter\n";
exit;
}
}
}
}
示例2: _e_tracking
function _e_tracking($section = 'product', $extra_params = array())
{
global $mc_edm_config;
$lang = i18n::get_instance();
$campaign = $mc_edm_config['campaign_name'];
$database = 'database-' . strtolower(_e_get_domain());
$section = $section == 'product' ? $lang->get_section() : $section;
$year = substr($mc_edm_config['launch_date'], 0, 4);
$extra = '';
if ($extra_params) {
$extra = '&' . http_build_query($extra_params, '', '&');
}
$content = "?utm_campaign={$campaign}_{$year}&utm_medium=email&utm_source={$database}&utm_content={$section}{$extra}";
return $content;
}