This widget enable syntax highlighting of code snippets in your web application using Google Code Prettify.
Yii 1.1.6 or above...(tested with 1.1.10)
$this->beginWidget('ext.prettify.JPrettify'); <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Code Sample</title> </head> <body> <b>Hello World!</b> </body> </html> <?php $this->endWidget();
$this->widget('ext.prettify.JPrettify',array( 'lang'=>"php5", 'showLineNumbers'=>true, 'pathAlias'=>"system.base", 'fileName'=>"CComponent.php", 'htmlOptions'=>array('style'=>'max-height: 340px; overflow-y: scroll;') ));
$this->widget('ext.prettify.JPrettify',array( 'fileName'=>"http://www.yiiframework.com/", 'htmlOptions'=>array('style'=>'max-height: 600px; overflow-y: scroll;')) );
Be the first person to leave a comment
Please login to leave your comment.