- 11
- 0
- 约3.87千字
- 约 5页
- 2017-04-10 发布于北京
- 举报
标签制作教程
导言
P8的标签作为系统核心的一个模块存在的,所有的标签都是通过标签模块来调用的.
打开根目录下的modules文件夹,找到label文件夹,如下图:
可以看到标签模块的文件结构和别的模块大致一样.如果对于模块比较熟悉的话,可以研究一下这个模块,这样制作标签就会更得心应手了,不过在这里不做详细讨论.现在主要的内容是如何来快速的制作一个标签DEMO.
1.公共标签label模块module.php和controller.php的内容,打开module.php文件,找到fetch类成员函数,找到下面的片断内容如下所示:
case flash:
$height = intval($label[option][height]) == 0 ? 260 : $label[option][height];
$width = intval($label[option][width]) == 0 ? 330 : $label[option][width];
$content = script type=text/javascript src={$RESOURCE}/js/media.js/script.
script type=text/javascript.
showMedia({.
url: {$label[option][flash][url]},.
width: {$width},.
height: {$height}.
});.
/script;
break;
上面是公共标签里的FLASH标签
在此代码的后面加上一个测试标签代码如下:
case test:
$content = $label[option][test][content];//这里是标签内容生成 break;
打开controller.php文件修改如下:
找到template目录下admin-core-label的add.html文件如下图:
打开add.html文件,打开下面内容:
span class=each_type
input name=type id=type_flash type=radio value=base_flash onclick=window.location.href=$this_url?system=$systemmodule=$modulepostfix=$postfixname=$nametype=flashid=$idname=$nameplace_holder_width=$place_holder_widthplace_holder_height=$place_holder_height/
label for=type_flashFLASH/label
/span
在后面加入如下代码:
span class=each_type
input name=type id=type_test type=radio value=base_test onclick=window.location.href=$this_url?system=$systemmodule=$modulepostfix=$postfixname=$nametype=testid=$idname=$nameplace_holder_width=$place_holder_widthplace_holder_height=$place_holder_height/
label for=type_test测试标签/label
/span
这里进入后台,添加标签,就可以看到公共标签里面就多了一项测试标签了
点击测试标签,可以看到如下图所示:
再找到modules-label-admin下面的add.php文件,如下图:
打开add.php文件
在switch语名中增加一个case代码如下:
case test:
include template($this_module, type_test, admin);
break;
再回到后台点添加标签,点击测试标签,可以看到如下内容:
出现以上内容说明此模板不存在,现在转到template-admin-core-label目录下面,新建一个文件type_test.html文件,内容如下:
!--{php168}--
!--{template $this_module header admin}--
script type=text/javascript
var label_type = test;
var action = $ACTION;
您可能关注的文档
- 国内外常见抗菌防霉准则.doc
- 国内外文化旅游展发模式比较.doc
- 国内外浏览器设计对比初探[组图].doc
- 国内外语类核心刊期信息一览表.doc
- 国内外风电标准情况汇报.docx
- 国内市场部门部职能.doc
- 国内旅游合同范本[天津].doc
- 国内机场三字代码航空公司二字代码和票证数字代码.doc
- 国内标准和国外标准对照.doc
- 国内汽车倒车雷达技术及产业发展状况浅析1.doc
- 腾讯安全沙龙:红队视角下的海外SRC猎场:战略、战术与突破.pdf
- 【icap】ETS的范围扩展:设计和政策挑战.docx
- bcg -美国最高法院关于关税的裁决对你的企业意味着什么 What Does the US Supreme Court Ruling on Tariffs Mean for Your Business.pdf
- 2026届甘肃兰州市高三下学期第一次模拟考试历史试卷(扫描版,含答案).docx
- bcg -零售银行如何让人工智能代理发挥作用 How Retail Banks Can Put AI Agents to Work.pdf
- 住宅项目规范解读(GB 55038-2025) -培训 - 房地产-2025.docx
- 盘扣式脚手架工程量自动计算表 -培训 -房地产-2025.pdf
- 广东省汕头市2024-2025学年高三下学期第一次模拟考试英语学试题(含答案).docx
- 品牌研究+_+2025+CAPSE中国航司品牌榜单.pdf
- 【银河专题】如何看待豆粕内外价差关系.pdf
原创力文档

文档评论(0)