本文整理汇总了PHP中Links::setAppearName方法的典型用法代码示例。如果您正苦于以下问题:PHP Links::setAppearName方法的具体用法?PHP Links::setAppearName怎么用?PHP Links::setAppearName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Links
的用法示例。
在下文中一共展示了Links::setAppearName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Page
$pages = new Page();
$category = new Category();
if (isset($_POST['pageId']) && $_POST['pageId'] != "" && isset($_POST['menuId']) && $_POST['menuId'] != "" && isset($_POST['isCategory']) && $_POST['isCategory'] == "false") {
// add pages to the menu
$menuId = $database->escapeString($_POST['menuId']);
$appearName = $database->escapeString($_POST['appearName']);
$links->setMenuId($menuId);
$links->setCategoryId(0);
$links->setIsCustomLink(0);
$links->setHttp("");
$startPos = $links->numByMenu($database) + 1;
foreach ($_POST['pageId'] as $id) {
if ($appearName == "") {
$pages->setPageId($id);
$pages->getById($database);
$links->setAppearName($pages->getPageName());
} else {
$links->setAppearName($appearName);
}
$links->setPosition($startPos);
$links->setPageId($id);
$links->create($database);
$startPos++;
}
echo "true";
} else {
if (isset($_POST['catIds']) && $_POST['catIds'] != "" && isset($_POST['menuId']) && $_POST['menuId'] != "" && isset($_POST['isCategory']) && $_POST['isCategory'] == "true") {
// add pages to the menu
$menuId = $database->escapeString($_POST['menuId']);
$appearName = $database->escapeString($_POST['appearName']);
$links->setMenuId($menuId);