GeSHI is a cool plugin which enables you to "embed" HTML ( or whatever ) code into your view.
usage of GeSHI can be:
Using GeSHI inside the content editor is simple, but what if we need to automatically embed code in a custom extension?
For example, when you create a "Our banners" module/component/... your customer will ask you to display the embed code for the visitors, and you can't tell him that he has to manually write the HTML code to embed the banners.
So, inside your code you only need to place this snippet:
// import GeSHI stuff
jimport('geshi.geshi');
jimport('domit.xml_saxy_shared');
// define the regex: this is the standard GeSHI regex, don't edit it
$regex = "#<pre xml:s*(.*?)>(.*?)</pre>#s";
// call GeSHI to edit the output of $myText
$myText = preg_replace_callback( $regex, 'plgContentGeshi_replacer', $myText );
That's it, GeSHI will automatically output the content as desired.
© 2012 Created by Amy Stephen.
You need to be a member of All Together, As A Whole to add comments!
Join All Together, As A Whole