O'Reilly logo

Joomla!™ Programming by Louis Landry, Mark Dexter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required