最新消息: 新版网站上线了!!!

yii显示高亮度代码的源码

            <p>PHP code</p>
<?php $this->beginWidget('CTextHighlighter',array('language'=>'PHP')); ?>
// include Yii bootstrap file
//require_once(dirname(__FILE__).'/../../framework/yii.php');
$yii='C:/yiiframework/yii.php';
// remove the following line when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
 
$config=dirname(__FILE__).'/protected/config/main.php';
 
// remove the following line when in production mode
// defined('YII_DEBUG') or define('YII_DEBUG',true);
 
require_once($yii);
Yii::createWebApplication($config)->run();
<?php $this->endWidget(); ?>
 
<p>PHP code with Line Number</p>
<?php $this->beginWidget('CTextHighlighter',array('language'=>'PHP','showLineNumbers'=>'true')); ?>
/**
 * SiteController is the default controller to handle user requests.
 */
class SiteController extends CController
{
    /**
     * Index action is the default action in a controller.
     */
    public function actionIndex()
    {
        
        $model=new DataModel();
        
        if(!empty($_POST[DataModel]))
        {
            $model->attributes=$_POST[DataModel];
            
            if($model->validate()) $success=true;
            
        }
        
        $this->render('index', array(
                'model' => $model,
            
                ));
    }
}
<?php $this->endWidget(); ?>
在线生成:http://www.kuitao8.com/api/hight

转载请注明:谷谷点程序 » yii显示高亮度代码的源码