0

What is the proper way to include the class JHTMLString in Joomla 2.5?

jimport('joomla.html.html.string');

and

jimport('joomla.html.string');

doesn't work. The only way I've managed to include this class is through:

JLoader::register('JHTMLString'), pathtotheclass);

Could this be a bug or am I missing something?

Stilero
  • 467
  • 4
  • 19
  • Where are you trying to load it? e.g. component, module, or a plugin - if a plugin what type? – Craig Oct 28 '12 at 00:26
  • No matter where I try, it simply doesn't work. Tried from Component entry file, plugin file, module file and so on. – Stilero Oct 31 '12 at 08:48

2 Answers2

0

It seems like your loading it in the only, atleast atm correct way:

http://docs.joomla.org/API16:JHtmlString

Because the normal way :

http://docs.joomla.org/JHtmlString/1.6

Doesn't seem to work, and I've tested it.

Mark Vink
  • 151
  • 5
  • Strange. Why should this class not be imported like all other classes in the Joomla library? – Stilero Oct 31 '12 at 08:47
  • Don't have a clue, I had a look around in the code and couldn't find something strange. Would you be so kind as to report it to the Joomla bug tracker ? – Mark Vink Nov 01 '12 at 12:15
0

A little bit late but I had the same problem on Joomla 2.5 so I had to call it like

JHtml::_('string.truncate', $text, 200);
Laoneo
  • 1,546
  • 1
  • 18
  • 25