本文整理汇总了PHP中CategoryModel::getCategoryNameById方法的典型用法代码示例。如果您正苦于以下问题:PHP CategoryModel::getCategoryNameById方法的具体用法?PHP CategoryModel::getCategoryNameById怎么用?PHP CategoryModel::getCategoryNameById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CategoryModel
的用法示例。
在下文中一共展示了CategoryModel::getCategoryNameById方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view_updateInput
public function view_updateInput()
{
$id = $_GET['id'];
if (intval($id) == 0) {
$status = "系统id错误";
header("Location:index.php?mod=property&act=getInputList&status={$status}");
exit;
}
$tName = 'pc_archive_input';
$select = '*';
$where = "WHERE id='{$id}'";
$inputList = OmAvailableModel::getTNameList($tName, $select, $where);
if (empty($inputList)) {
$status = "错误,不存在该文本属性";
header("Location:index.php?mod=property&act=getInputList&status={$status}");
exit;
}
$categoryStr = '';
if (!empty($inputList[0]['categoryPath'])) {
$tmpCateNameArr = array();
$tmpCategoryArr = explode('-', $inputList[0]['categoryPath']);
foreach ($tmpCategoryArr as $value) {
$tmpCateNameArr[] = CategoryModel::getCategoryNameById($value);
}
$categoryStr = implode('->', $tmpCateNameArr);
}
$navlist = array(array('url' => 'index.php?mod=category&act=getCategoryList', 'title' => '类别管理'), array('url' => 'index.php?mod=property&act=getInputList', 'title' => '文本属性列表'), array('url' => "index.php?mod=property&act=updateInput&id={$id}", 'title' => '修改文本属性'));
$this->smarty->assign('navlist', $navlist);
$this->smarty->assign('onevar', 4);
$this->smarty->assign('twovar', 43);
$this->smarty->assign('title', '修改属性');
$this->smarty->assign('id', $id);
$this->smarty->assign('inputName', $inputList[0]['inputName']);
$this->smarty->assign('categoryStr', $categoryStr);
$this->smarty->display("updateInput.htm");
}
示例2: getAllCateNameByPath
function getAllCateNameByPath($pid)
{
$categorySearch = '';
if (!empty($pid)) {
$tmpCateNameArr = array();
$tmpCategoryArr = array_filter(explode('-', $pid));
foreach ($tmpCategoryArr as $value) {
if (!empty($value)) {
$tmpCateNameArr[] = CategoryModel::getCategoryNameById($value);
}
}
$categorySearch = implode('->', $tmpCateNameArr);
}
return $categorySearch;
}