How to set Component parameters in J2.5?

后端 未结 2 1897
甜味超标
甜味超标 2021-01-14 09:30

I\'ve created a J2.5 component with some config fields using config.xml in the admin folder of the component.

How can I set parameters in the config programatically?

2条回答
  •  悲&欢浪女
    2021-01-14 09:58

    The solution is here...

    http://www.webtechriser.com/tutorials/82-joomla-3-0/86-how-to-save-component-parameters-to-database-programmatically

    You can replace in Joomla 2.5+ the

    // check for error
    if (!$table->check()) {
        $this->setError('lastcreatedate: check: ' . $table->getError());
        return false;
    }
    if (!$table->store()) {
        $this->setError('lastcreatedate: store: ' . $table->getError());
        return false;
    }
    

    with

    if (!$table->save()) {
        $this->setError('Save Error: ' . $table->getError());
        return false;
    }
    

提交回复
热议问题