![]() |
|
sfGeshiFormatterPlugin - 0.5.1a code formatter plugin for symfony |
|
![]() |
1
user
Sign-in
to change your status |
The |
The sfGeshiFormatter is a symfony plugin that enables a bb code like syntax
for nice code outputs using geshi http://qbnz.com/highlighter
for now, you need to have this pecl extension installed http://de3.php.net/manual/en/book.bbcode.php
Install the plugin
$ symfony plugin:install sfGeshiFormatterPlugin -s beta
Install the PECL Extension
a good installation guide can be found here:
http://de3.php.net/manual/en/book.bbcode.php
for supported languages look at the geshi project homepage at http://qbnz.com/highlighter/
* to beautify your text use the "Geshi" Helper and put your text into this function : geshi_beautify()
$text = <<<EOF
this is normal text
[code=php]
/* A simple php script */
$choice = $_GET['foo'];
if ( $choice == 1 )
{
echo 'You like coffee!';
}
elseif ( $choice == 2 )
{
echo 'I said, "You like coffee!"';
}
echo ""Isn't coffee horrible though?"";
[/code]
normal text
EOF;
*
use_helper('Geshi');
echo geshi_beautify($text);
| Name | Status | |
|---|---|---|
|
|
lead |
MIT http://www.symfony-project.com/license