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


PHP Lang::current方法代碼示例

本文整理匯總了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();
     }
 }
開發者ID:mbcraft,項目名稱:frozen,代碼行數:27,代碼來源:CommentiController.class.php

示例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;
 }
開發者ID:joksnet,項目名稱:php-old,代碼行數:10,代碼來源:Lang.php

示例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;
     }
 }
開發者ID:joksnet,項目名稱:php-old,代碼行數:20,代碼來源:Session.php

示例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();
開發者ID:joksnet,項目名稱:php-old,代碼行數:21,代碼來源:common.php

示例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";
}
開發者ID:mbcraft,項目名稱:frozen,代碼行數:9,代碼來源:comment_result.block.php

示例6: var_dump

<?php

require_once __DIR__ . '/vendor/autoload.php';
var_dump(Lang::current());
Lang::force('ar');
var_dump(Lang::current());
開發者ID:emados,項目名稱:php-statical,代碼行數:6,代碼來源:index.php


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