本文整理汇总了PHP中Lang::current方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::current方法的具体用法?PHP Lang::current怎么用?PHP Lang::current使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lang
的用法示例。
在下文中一共展示了Lang::current方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: invia_commento
function invia_commento()
{
try {
$nome = Params::get("nome");
$subject = Params::get("subject");
$email = Params::get("email");
$testo = Params::get("testo");
//$codice_hidden = Params::get("codice_hidden");
//$codice = Params::get("codice");
//if ($codice_hidden!=$codice)
// throw new InvalidParameterException("Il codice non e' impostato correttamente!!");
if ($nome != null && $subject != null && $email != null && $testo != null && isset(Config::instance()->EMAIL_COMMENT_RECEIVED)) {
$e = new EMail("no_reply@" . Host::current_no_www(), Config::instance()->EMAIL_COMMENT_RECEIVED, "[Nuova commento da : " . $nome . "] - " . Host::current(), EMail::HTML_FORMAT);
$e->render_and_send("include/messages/mail/alert/" . Lang::current() . "/nuovo_commento.php.inc", array("nome" => $nome, "email" => $email, "subject" => $subject, "testo" => $testo));
return Redirect::success();
} else {
if (!isset(Config::instance()->EMAIL_COMMENT_RECEIVED)) {
throw new InvalidDataException("Il parametri di configurazione EMAIL_COMMENT_RECEIVED non e' impostato correttamente!!");
} else {
throw new InvalidDataException("I dati immessi nella form non sono validi!!");
}
}
} catch (Exception $ex) {
Flash::error($ex->getMessage());
return Redirect::failure();
}
}
示例2: current
public static function current($current = null)
{
global $root;
if ($current) {
self::$current = $current;
} elseif (isset($_GET['lang']) && file_exists("{$root}/lang/{$_GET['lang']}.php")) {
self::$current = $_GET['lang'];
}
return self::$current;
}
示例3: start
/**
* Begins the session.
*/
public static function start()
{
session_start();
if (isset($_SESSION[self::$name . '_SID'])) {
self::$sid = $_SESSION[self::$name . '_SID'];
self::$data = $_SESSION[self::$name . '_DATA'];
} else {
self::$sid = md5(time());
self::$data = array('lang' => Lang::current(), 'uid' => 0);
$_SESSION[self::$name . '_SID'] = self::$sid;
$_SESSION[self::$name . '_DATA'] = self::$data;
}
Lang::load(self::_('lang'));
if (self::$data['uid']) {
self::$logged = true;
}
}
示例4:
<?php
@error_reporting(E_ALL ^ E_NOTICE);
@set_magic_quotes_runtime(0);
if (empty($root)) {
$root = '.';
}
/**
* @ignore
*/
$theme = 'default';
require_once "{$root}/includes/String.php";
require_once "{$root}/includes/Lang.php";
require_once "{$root}/includes/Session.php";
require_once "{$root}/includes/Db.php";
Db::connect($configdb);
$config = Db::fetchPairs("SELECT name, value\n FROM config");
if (isset($config['lang'])) {
Lang::current($config['lang']);
}
Session::start();
示例5: call
<?php
$success = call("form_submit", "is_comment_successfull");
$lang = Lang::current();
if ($success) {
include "include/messages/commenti/" . $lang . "/commento_ok.block.php";
} else {
include "include/messages/commenti/" . $lang . "/errore_commento.block.php";
}
示例6: var_dump
<?php
require_once __DIR__ . '/vendor/autoload.php';
var_dump(Lang::current());
Lang::force('ar');
var_dump(Lang::current());