PHPCMS V9新增自定义全局变量,模版统一调用与修改

一、系统配置修改
修改网站配置文件system.php
文件路径:/caches/configs/system.php

'app_ask' => 'https://www.dst2.com/ask',//在线咨询URL

修改网站配置文件base.php
文件路径:/phpcms/base.php

//在线咨询URL
define('APP_ASK',pc_base::load_config('system','app_ask'));

二、后台修改
为了尽可能的方便维护全局变量,我们可以修改后台模版,如此便可以在后台修改变量的值

修改网站setting.tpl.php文件

/phpcms/modules/admin/templates/setting.tpl.php,第73行左右

<tr>
    <th width="120"><?php echo L('setting_app_ask')?></th>
    <td class="y-bg"><input type="text" class="input-text" name="setconfig[app_ask]" id="app_ask" size="50" value="<?php echo $app_ask?>" /></td>
  </tr>

修改网站admin.lang.php文件,添加语言包
文件路径:/phpcms/languages/zh-cn/admin.lang.php ,在第170行左右

$LANG['setting_app_ask'] = '在线咨询URL';

留下评论

您的邮箱地址不会被公开。 必填项已用 * 标注