Please enable JavaScript to view this site.

The manual for the JobRouter developer

Navigation: Dashboard API > Methods and objects of the dashboard API > Overwritable methods

Template of the widget (getTemplate)

Scroll Prev Top Next More

This function returns the handlebars template. Overwriting the function is optional. If no custom implementation is specified, the content of the template.hbs file is loaded into the widgets directory.

Please note: The selection of the template should not depend on the data since it can not be guaranteed that the template will be updated when the data is updated.

Example:

public function getTemplate()

{

    $customTemplatePath = $this->getWidgetFilePath('../shared_files/custom_widget.hbs');

    if (file_exists($customTemplatePath)) {

        return file_get_contents($customTemplatePath);

    }

 

    return parent::getTemplate();

}