You cannot directly refer to a specific function in a model or view.
But any public methods without parameters in the controller will be called using
yoursite/index.php?option=com_yourcomponent&task=yourpublicmethod.
This will call the specified method and display it in the Joomla template with all the relevant modules, etc.
If you want only the output of the main component, add to the call
&tmpl=component
which is displayed through the component.php template instead of index.php, usually the first one loads external resources (css and js) and the output of the main component.
If the function returns the code (html xml or json), you can call it with
&format=raw
which returns only the bare output of your public method. This can also be achieved at the component level with instruction
exit;
at the end of your public method implementation
source share