CodeIgniter Forums
Anyone implemented geshi on their CI projects? Or another syntax highlighter? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Anyone implemented geshi on their CI projects? Or another syntax highlighter? (/thread-1860.html)



Anyone implemented geshi on their CI projects? Or another syntax highlighter? - El Forum - 07-01-2007

[eluser]manilodisan[/eluser]
As the title goes...Anyone implemented geshi on their CI projects? Or another syntax highlighter?


Anyone implemented geshi on their CI projects? Or another syntax highlighter? - El Forum - 09-04-2008

[eluser]bAum[/eluser]
I just stumbled accross this posting doing a google search on the subject, its really not hard to do (taken from here):

All you need to do is copy "geshi.php" as well as the "geshi" folder into a new folder "application/plugins/geshi", and then to create a file "geshi_pi.php" within "application/plugins" with the following content:

Code:
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');

function colorize($source, $language)
{
require_once(APPPATH.'plugins/geshi/geshi.php');
$geshi = new GeSHi(html_entity_decode($source), $language);
$geshi->set_header_type('');
return $geshi->parse_code();
}
?>

That's it. To use it, you need load the plugin with $this->load->plugin(’geshi’) and can then play around with the colorize() function.