本文整理汇总了PHP中CApp::getTranslate方法的典型用法代码示例。如果您正苦于以下问题:PHP CApp::getTranslate方法的具体用法?PHP CApp::getTranslate怎么用?PHP CApp::getTranslate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CApp
的用法示例。
在下文中一共展示了CApp::getTranslate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createAction
public function createAction()
{
CApp::setTitle(CApp::getAppName() . " | " . CApp::getTranslate('createUser'));
if ($_SESSION["userRole"] == CApp::settings("USER_ROLES")->ADMIN) {
$model = new UserModel();
if (!empty($_POST["user"])) {
foreach ($_POST["user"] as $key => $value) {
$arrPost[$key] = filterGetValue($value);
}
$model->create($arrPost);
}
$this->render("create", "user");
} else {
CApp::redirect("/");
}
}
示例2: settingsAction
public function settingsAction()
{
if ($_SESSION["userRole"] == CApp::settings("USER_ROLES")->ADMIN) {
CApp::setTitle(CApp::getAppName() . " | " . CApp::getTranslate('settings'));
$arrResult = CApp::getSettingsArray();
if (!empty($_POST["SETTINGS"])) {
$settingsArray = array();
foreach ($_POST["SETTINGS"] as $key => $value) {
$settingsArray[$key] = filterGetValue($value);
}
$model = new SiteModel();
$arrResult = $model->update($settingsArray);
}
$this->render("settings", "site", $arrResult);
} else {
CApp::redirect("/");
}
}
示例3: indexAction
public function indexAction()
{
if ($_SESSION["userRole"] == USER_ROLE_ADMIN) {
CApp::setTitle(CApp::getAppName() . " | " . CApp::getTranslate('translateApp'));
$arrResult = CApp::getTranslateAll();
if (!empty($_POST["TRANSLATE"])) {
$translateArray = array();
foreach ($_POST["TRANSLATE"] as $key => $value) {
if ($key == "newVal" && empty($value[0]) && empty($value[1])) {
continue;
}
if (empty($value[0]) && empty($value[1])) {
continue;
}
$translateArray[filterGetValue($value[0])] = filterGetValue($value[1]);
}
$model = new TranslateModel();
$arrResult = $model->update($translateArray, $arrResult);
}
$this->render("changeTranslate", "translate", $arrResult);
} else {
CApp::redirect("/");
}
}
示例4:
?>
</td>
<td><?php
echo CApp::getTranslate("date_register");
?>
</td>
<td><?php
echo CApp::getTranslate("phone");
?>
</td>
<td><?php
echo CApp::getTranslate("email");
?>
</td>
<td><?php
echo CApp::getTranslate("delete");
?>
</td>
</tr>
<?php
foreach ($arrResult as $arItem) {
$linkView = CApp::getLink(array("controller" => "user", "view" => "view", "id" => $arItem["id"]));
$linkDelete = CApp::getLink(array("controller" => "user", "view" => "delete", "id" => $arItem["id"]));
?>
<tr>
<td><?php
echo $arItem["id"];
?>
</td>
<td><a href="<?php
echo $linkView;
示例5:
<tr>
<td><?php
echo CApp::getTranslate('phone');
?>
</td>
<td><input name="registerForm[phone]" type="text"/></td>
</tr>
<tr>
<td><?php
echo CApp::getTranslate('email');
?>
</td>
<td><input name="registerForm[email]" type="text"/></td>
</tr>
<tr><td></td>
<td><input type="submit" value="<?php
echo CApp::getTranslate('register');
?>
" /></td>
</tr>
</form>
<tr>
<td colspan="2"><a href="<?php
echo CApp::getLink(array("controller" => "site", "view" => "index"));
?>
"><?php
echo CApp::getTranslate("enter");
?>
</a></td>
</tr>
</table>
示例6:
</tr>
<tr>
<td><?php
echo CApp::getTranslate("phone");
?>
</td>
<td><input type="text" name="user[phone]" value="<?php
echo $arrResult["phone"];
?>
"></td>
</tr>
<tr>
<td><?php
echo CApp::getTranslate("date_register");
?>
</td>
<td><?php
echo $arrResult["date_register"];
?>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="save" value="<?php
echo CApp::getTranslate("save");
?>
"></td>
</tr>
</table>
</form>
</div>
示例7:
echo CApp::getTranslate("createUser");
?>
</a></li>
<li><a href="<?php
echo CApp::getLink(array("controller" => "user", "view" => "index"));
?>
"><?php
echo CApp::getTranslate("allUsers");
?>
</a></li>
<li><a href="<?php
echo CApp::getLink(array("controller" => "translate", "view" => "index"));
?>
"><?php
echo CApp::getTranslate("translate");
?>
</a></li>
<li><a href="<?php
echo CApp::getLink(array("controller" => "site", "view" => "settings"));
?>
"><?php
echo CApp::getTranslate("settings");
?>
</a></li>
</ul>
</div>
<div class="column2">
<p>
О продукте
</p>
</div>
示例8:
<div class="column1">
<ul class="menu">
<li><a href="<?php
echo CApp::getLink(array("controller" => "site", "view" => "index"));
?>
"><?php
echo CApp::getTranslate("createUser");
?>
</a></li>
<li><a href="<?php
echo CApp::getLink(array("controller" => "site", "view" => "about"));
?>
"><?php
echo CApp::getTranslate("allUsers");
?>
</a></li>
<li><a href="<?php
echo CApp::getLink(array("controller" => "site", "view" => "register"));
?>
"><?php
echo CApp::getTranslate("translate");
?>
</a></li>
</ul>
</div>
<div class="column2">
<p><?php
echo __FILE__;
?>
</p>
</div>