News and Announcements > General Discussion

how include custom html snippet within plugin to page template

(1/1)

sago:
Hi there,

I'm developing a new plugin on roundcube that show custom select on options list popup.

I've created a new plugin and enabled it in config.inc.php (
--- Code: ---$config['plugins'] = array('myplugin');
--- End code ---
), then inside plugin folder I've created myplugin.php and /skins/elastic/template/myplugin.html.

inside myplugin.html I've written:


--- Code: ---<div class="form-group row form-check">
    <label for="compose-am" class="col-form-label col-6"><roundcube:label name="returnreceipt" /></label>
    <div class="col-6 form-check">
      <roundcube:object name="amCheckBox" id="compose-am" noform="true" tabindex="2" class="form-check-input" />
    </div>
  </div>
--- End code ---

now I want to include this file inside myplugin.php, so I can use the roundcube template engine. There is a way?

Thanks a lot.

JohnDoh:
in your plugin you need to have a line like this:

--- Code: ---$rcube = rcube::get_instance();
$rcube->output->send('pluginname.templatename');

--- End code ---
there is a little more info here https://github.com/roundcube/roundcubemail/wiki/Plugin-API#templates

Navigation

[0] Message Index

Go to full version