JHtmlString: Difference between revisions
From Joomla! Documentation
New page: <span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</span>
{{Description:JHtmlString}}
===Defined in==... |
m preparing for archive only |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
Contains methods for working with strings of HTML text. | |||
===Defined in=== | ===Defined in=== | ||
| Line 20: | Line 17: | ||
===Importing=== | ===Importing=== | ||
<source lang="php"> | <source lang="php">JLoader::register('JHtmlString', JPATH_LIBRARIES.'/joomla/html/html/string.php');</source> | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=JHtmlString | category=JHtmlString | ||
namespace=CodeExample | |||
category=ClassExample | category=ClassExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
Latest revision as of 01:47, 25 March 2017
Contains methods for working with strings of HTML text.
Defined in
libraries/joomla/html/html/string.php
Methods
| Method name | Description |
|---|---|
| truncate | Truncates text blocks over the specified character limit. The behavior will not truncate an individual word, it will find the first space that is within the limit and truncate at that point. This method is UTF-8 safe. |
| abridge | Abridges text strings over the specified character limit. The behavior will insert an ellipsis into the text replacing a section of variable size to ensure the string does not exceed the defined maximum length. This method is UTF-8 safe. |
Importing
JLoader::register('JHtmlString', JPATH_LIBRARIES.'/joomla/html/html/string.php');
Examples
Code Examples