Welcome Guest, Not a member yet? Register   Sign In
Displaying coding language in end user view
#1

[eluser]elaniobro[/eluser]
I have been reading through the forums and the wiki, I have not seen any instance or refrence to what I am trying to accomplish, perhaps it is due to a lack of vocab on the subject.

I would like to do what this forum does. Essential use[code[]/code] (I reversed them so you can see) to display Code on the webpage. Is their a helper/library out there that can achieve this?

So in essense I would like to be able to display code on my site similar to how you see it below:
Code:
$this->load->view('header', $data);
            $this->load->view('campaign');
            $this->load->view('thoughts_view', $data);
            $this->load->view('footer');

It would be even better if you can get Line numbers involved.
#2

[eluser]John_Betong[/eluser]
Play around with this and see if it help:
Code:
<?php highlight_file( __FILE__ ); ?>
 
 
 
#3

[eluser]elaniobro[/eluser]
Thanks, could you point me to the documentation for that so I can read up on it?

Appreciate the help Smile
#4

[eluser]John_Betong[/eluser]
[quote author="elaniobro" date="1267601772"]Thanks, could you point me to the documentation for that so I can read up on it?

Appreciate the help Smile[/quote]

A quick Google and...

http://php.net/manual/en/function.highlight-file.php

I also discovered show_source(...) but have not tried it.

And an example:

http://johns-jokes.com/downloads/codeign...ss_tables/

 
 




Theme © iAndrew 2016 - Forum software by © MyBB