您现在的位置是:首页 > 教程 > 易优cms教程易优cms教程
易优根据aid获取文档页面链接
柯河舍2023-08-25 22:24:40易优cms教程已有人查阅
导读1、在根目录下\extend\function.php中创建方法:2、在需要使用文档链接的地方调用方法:
1、在根目录下\extend\function.php中创建方法:
{$field.aid|diy_get_arcurl=###,$field.typeid}获取文档页面链接
if (!function_exists(‘diy_get_arcurl’))
{
/**
* 获取前台文档的URL
* @param integer $aid 文档ID
* @param integer $typeid 栏目ID
* @return [type] [description]
*/
function diy_get_arcurl($aid = 0, $typeid = 0){
$url = ”;
if (!empty($aid)) {
static $arctypeList = null;
if (null === $arctypeList) {
$arctypeList = \think\Db::name(‘arctype’)->order(‘id asc’)->getAllWithIndex(‘id’);
}
$row = !empty($arctypeList[$typeid]) ? $arctypeList[$typeid] : [];
if (!empty($row)) {
$row[‘aid’] = $aid;
$url = arcurl(‘home/View/index’, $row);
}
}
return $url;
}
}
2、在需要使用文档链接的地方调用方法:{$field.aid|diy_get_arcurl=###,$field.typeid}获取文档页面链接
本文标签:
很赞哦! ()
相关文章
随机图文
-
易优CMS序号标签从2开始的方法
从0开始的办法{$key}从1开始的办法{$i}如果想从2开始怎么办?只需+1就可实现{$i+1} -
易优cms怎么在本地使用授权或插件
这里以phpstudy为例,顺便附上phpstudy的安装教程:第一种情况:还没有域名的情况下,想要测试某个插件,先在官网下单,补全插件域名 -
易优cms模用eyou.field.typegrade实现栏目页全部高亮的方法
易优cms栏目模板如何实现【全部】高亮?可以用易优cms判断下级分类有无标签来实现:易优cms判断下级栏目是否为空的实现代码: -
易优cms模板调用封面图片的方法
看使用的场景列表页调用文档封面的标签为:需要结合循环标签使用内容页调用文档封面的标签为:{$eyou.field.litpic}
留言与评论 (共有 条评论) |