4

I am working on a custom component and it works as intended as long as I do not have cache enabled.

In the admin section of the component, I have a view that can change the "component params":

$params = JComponentHelper::getParams( 'com_example' );
$params->set( 'customsetting', 'test' );

$componentid = JComponentHelper::getComponent('com_example')->id;
$table = JTable::getInstance('extension');
$table->load($componentid);
$table->bind(array('params' => $params->toString()));

if (!$table->check()) {
    echo $table->getError();
}
if (!$table->store()) {
    echo $table->getError();
}

and load that setting with

$params = JComponentHelper::getParams( 'com_example' );
$setting = $params->get( 'customsetting' );

As I mentioned, this works without cache. But with cache, I cannot update the setting.

I guess I need to clear the cache after I change the component parameters, but I could not figure out how.

I tried parent::cleanCache('com_hbmanager');, but it had no effect. https://docs.joomla.org/Cache also didn't help me finding a solution.

Is there a way to clear the cache for the parameters of a component?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.