Appendix C. JHtml Methods
The folder libraries/joomla/html contains a number of useful methods for creating Joomla! applications. In this appendix, we briefly describe some of them. Note that these methods are all static methods. The details for using these methods are documented at the site http://api.joomla.org/li_Joomla-Platform.html.
Calling JHtml Methods
JHtml methods are designed to be convenient to use by designers and others who are not experienced PHP coders. One handy thing about these methods is that they can be automatically imported as needed. The syntax for this is simple. Consider this example:
<?php echo JHTML::_('string.truncate', $item->introtext, $params->get('introtext_limit')); ?>
Here we use the _() method of JHtml (libraries/joomla/html/html.php ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access