检查magento system.xml中文本字段的保留字

检查magento system.xml中文本字段的保留字,magento,magento-1.7,magento-1.6,Magento,Magento 1.7,Magento 1.6,如何检查或验证我在magento system.xml中声明的文本字段我的意思是当我在文本字段中输入单词并按下save config按钮时,它将显示消息“这是保留单词”。 在这里,我可以为system.xml文本字段调用或设置此函数。over代码为 public function isReserveWord($word) { $is_reserved = false; $reserve_words = array('supportportal','view','search',

如何检查或验证我在magento system.xml中声明的文本字段我的意思是当我在文本字段中输入单词并按下save config按钮时,它将显示消息“这是保留单词”。 在这里,我可以为system.xml文本字段调用或设置此函数。over代码为

public function isReserveWord($word) {

    $is_reserved = false;
    $reserve_words = array('supportportal','view','search','askquestion');
    if (in_array($word,$reserve_words)) {
    $is_reserved = true;}
    return $is_reserved;}

是的,您可以使用system.xml进行管理,在扩展中创建自己的表单

在这里我可以给你很好的文件链接,这将对你非常有用

只要仔细理解,您肯定可以通过服务器端验证来实现这一点


希望这一定会对你有所帮助。

@FarmanUllah欢迎,如果你能接受并投票支持我的答案,我将非常高兴。所以有人可以在将来的参考中使用它。