本文整理汇总了PHP中I18n::L方法的典型用法代码示例。如果您正苦于以下问题:PHP I18n::L方法的具体用法?PHP I18n::L怎么用?PHP I18n::L使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类I18n
的用法示例。
在下文中一共展示了I18n::L方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
if (User::Logged()) {
// Validation for user input
if (empty($_POST["idea_title"]) || empty($_POST["idea_description"])) {
$error_message = I18n::L("Please fill title and description.");
}
if (strlen($_POST["idea_title"]) > 115) {
$error_message = I18n::L("Your idea title is too long.");
}
if (empty($error_message)) {
$idea = Idea::Add(Idea::Create($_POST["idea_title"], $_POST["idea_description"], User::$current));
header("Location:" . PREFIX . "/idea?" . $idea->idea_id);
exit;
} else {
Viewer::AddData("idea_title", $_POST["idea_title"]);
Viewer::UseTemplate("new_idea.tpl");
Viewer::AddData("title", I18n::L("Title New Idea"));
Viewer::AddData("error_message", $error_message);
}
} else {
Viewer::Restricted();
}
$action = "new_idea";
}
// Default view
if (!empty($id)) {
if ($idea = Idea::GetById($id)) {
Viewer::AddData("comments", Comments::GetByIdea($idea));
Viewer::AddData("idea", $idea);
Viewer::AddData("title", $idea->idea_title);
if (isset($_GET["rate_plus"])) {
$rated = 3;
示例2: array
} else {
if (User::FindUser($user_name)) {
$error_message = I18n::L("Username «%s» is already taken, please find another username.", array($user_name));
} else {
if (User::FindUserByEmail($user_email)) {
$error_message = I18n::L("This email «%s» is already regesitered, please use another email.", array($user_email));
} else {
$obj = User::Add(User::Create($user_name, $user_email, $_POST["user_password"]));
if ($obj->user_id) {
Session::StartUser($obj);
header("Location:" . PREFIX . "/dashboard/");
exit;
} else {
$error_message = I18n::L("Error while registring user.");
}
//todo: add some error log
}
}
}
}
} else {
if (!empty($_POST["register"])) {
$error_message = I18n::L("Please fill all required fields.");
}
}
Viewer::AddData("title", I18n::L("Title Registration"));
Viewer::AddData("error_message", $error_message);
Viewer::UseTemplate("register.tpl");
Viewer::AddData("action", $action);
Viewer::Show();
ob_end_flush();
示例3: ob_start
<?php
/**
* @package zoneideas
* @subpackage dashboard
* @author Serg Podtynnyi <serg.podtynnyi@gmail.com>
*/
/**
*
*
*/
ob_start();
include_once "../core.php";
$action = false;
if (User::Logged()) {
Viewer::AddData("ideas", Ideas::GetByUser(User::$current));
Viewer::AddData("user", User::$current);
Viewer::AddData("title", I18n::L("Title Dashboard"));
Viewer::UseTemplate("dashboard.tpl");
$action = "dashboard";
} else {
Viewer::Restricted();
$action = "restricted";
}
if (!$action) {
Viewer::RequestError();
}
Viewer::AddData("action", $action);
Viewer::Show();
ob_end_flush();
示例4: ob_start
/**
*
*
*/
ob_start();
include_once "../core.php";
$action = "login";
if (!empty($_POST["login"])) {
if (!empty($_POST["user_name"]) && !empty($_POST["user_password"])) {
$obj = User::CheckUser($_POST["user_name"], $_POST["user_password"]);
User::$current = Session::StartUser($obj);
} else {
$error_message = I18n::L("Please fill all required fields.");
}
}
if (User::Logged()) {
header("Location:" . PREFIX . "/dashboard/");
exit;
}
if (!empty($_POST["login"]) && !User::Logged()) {
if (empty($error_message)) {
$error_message = I18n::L("Wrong password.");
}
Viewer::AddData("error_message", $error_message);
Viewer::AddData("user_name", $_POST["user_name"]);
}
Viewer::AddData("title", I18n::L("Title Login"));
Viewer::UseTemplate("login.tpl");
Viewer::AddData("action", $action);
Viewer::Show();
ob_end_flush();