I have this code in a plugin. The only function inside the original CSS class is tag
so I tried to return something else.
<?php
class TestClass extends Kirby\Component\CSS {
public function tag($url, $media = null) {
return 'Test';
}
}
$kirby->set('component', 'CSS', 'TestClass');
I get no errors, but the CSS output in my template is still the same CSS file html. It seems like nothing happends. I expected Test
as output or at least an error.
From the docs
A component can be registered in a plugin file with the kirby()->set() method:
$kirby->set(‘component’, ‘thumb’, ‘MyThumbClass’);
With the second argument, you specify which of the components you want to replace. The classname of your custom component class must be passed as last argument. The class must be loadable or exist.
Your custom class must extend the default component class!
What did I miss?