Home >Backend Development >PHP Tutorial >DEDECMS-helper小副手扩展

DEDECMS-helper小副手扩展

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 12:13:56937browse

DEDECMS-helper小助手扩展

今天在做DEDE动态调用模板的时候卡住了,后终被强大的互联网解决,记录解决问题的过程,以备后用

可以在/data/helper.inc.php中进行默认小助手初始化的设置,系统默认载入小助手

例如创建一个示例小助手文件test.helper.php

<span style="color: #008080;">1</span> <span style="color: #0000ff;">if</span> (!<span style="color: #008080;">function_exists</span>('HelloDede'<span style="color: #000000;">)){</span><span style="color: #008080;">2</span>     <span style="color: #0000ff;">function</span><span style="color: #000000;"> HelloDede(){</span><span style="color: #008080;">3</span>         <span style="color: #0000ff;">echo</span> "Hello! Dede..."<span style="color: #000000;">;</span><span style="color: #008080;">4</span> <span style="color: #000000;">    }</span><span style="color: #008080;">5</span> }

初始化:helper('test');

使用:HelloDede();

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn