简体   繁体   English

CS-cart - 将变量分配到配置文件中

[英]CS-cart - assigning variables into config file

In my CS-cart 4 PHP project I have a Smarty 3 (tpl) view file..在我的CS-cart 4 PHP项目中,我有一个Smarty 3 (tpl) 视图文件..

There I have defined one JavaScript function like:在那里,我定义了一个 JavaScript 函数,例如:

 <script type="text/javascript">

            api_key: 'JSABFISAG472IB4'

  ....

I am very new at using it, so I wanted to ask/check if this hardcoded API key could be added on a config?我对使用它很陌生,所以我想问/检查这个硬编码的 API 密钥是否可以添加到配置中? Where and how?在哪里以及如何? Still have a trouble finding similar examples online..仍然很难在网上找到类似的例子..

Checked: CS-cart documentation已检查: CS-cart 文档

Checked: Smarty Help Forum勾选: Smarty 帮助论坛

Do you have a config.php or config.local.php file?你有 config.php 或 config.local.php 文件吗? if not create one and add it there define('KEY','1234567890');如果没有创建一个并将其添加到那里define('KEY','1234567890'); And call it like this in tpl {$smarty.const.KEY}并在 tpl {$smarty.const.KEY} 中这样称呼它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM