User tests: Successful: Unsuccessful:
This PR adds regexReplaceInTemplate function to JDocumentHTML
This can be used for adding/replacing html in the current template, like, for instance, adding HTML5 data-* attributes used by javascript.
Examples of usage:
JFactory::getDocument()->regexReplaceInTemplate('<body', '<body data-json=\''.json_encode(array('item1' => 'value1', 'item2' => 'value2')).'\'');
JFactory::getDocument()->regexReplaceInTemplate('<body', '<body data-var="1"');
Of course, since is a regex replace of the template HTML this can be used for many other things before the final html is rendered.
caption function.<body data-json='{"item1":"value1","item2":"value2"}' None
| Status | New | ⇒ | Pending |
| Labels |
Added:
?
|
||
| Status | Pending | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-11-24 15:57:13 |
| Closed_By | ⇒ | andrepereiradasilva |
this doen't work on admin template so i will close it and try another way.