本文整理汇总了PHP中CApp::setTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP CApp::setTitle方法的具体用法?PHP CApp::setTitle怎么用?PHP CApp::setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CApp
的用法示例。
在下文中一共展示了CApp::setTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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("/");
}
}