By default, OctoberCMS plugin components render the partial default.htm
. Is it possible to override which partial will be rendered? For example ...
Plugin file structure
├── components
│ ├── example
│ │ ├── default.htm
│ │ ├── other_partial.htm
│ ├── Example.php
├── ...
├── Plugin.php
Example.php
class Example extends ComponentBase {
public function onRun() {
// change the rendered partial, such that other_partial.htm
// will be rendered instead of default.htm
$this->setRenderedPartial('other_partial')
}
}
I know that it is possible to render the other_partial
from inside the default.htm
but in my case I seek to leave the default.htm
untouched and render the other partial as default instead.