API16

JHtmlString: Difference between revisions

From Joomla! Documentation

Dextercowley (talk | contribs)
fix importing. can't use standard jimport because class is JHtmlString, not JString
m clean up
Line 1: Line 1:
<span class="editsection" style="font-size:76%;">
Contains methods for working with strings of HTML text.
<nowiki>[</nowiki>[[Description:JHtmlString|Edit Descripton]]<nowiki>]</nowiki>
</span>
{{Description:JHtmlString}}


===Defined in===
===Defined in===
Line 22: Line 19:
<source lang="php">JLoader::register('JHtmlString', JPATH_LIBRARIES.'/joomla/html/html/string.php');</source>
<source lang="php">JLoader::register('JHtmlString', JPATH_LIBRARIES.'/joomla/html/html/string.php');</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JHtmlString|Edit See Also]]<nowiki>]</nowiki>
{{subst:SeeAlso:JHtmlString}}
</span>
{{SeeAlso:JHtmlString}}


===Examples===
===Examples===

Revision as of 14:07, 24 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');


{{subst:SeeAlso:JHtmlString}}

Examples

<CodeExamplesForm />