开发者社区> 问答> 正文

php 字符串里面同时有 "" 和 ' ,本身又是字符串怎么办?

落地花开啦 2016-06-16 16:24:23 694

php 字符串里面同时有 "" 和 ' ,本身又是字符串怎么办?

//已解决
"sDom": "<\'row\'<\'span8\'l><\'span8\'f>r>t<\'row\'<\'span8\'i><\'span8\'p>>",

//这句会报错的 
"sDom": "<'row'<'span8'l><'span8'f>r>t<'row'<'span8'i><'span8'p>>",

<?php
/* @var $this CategoryController */
/* @var $model Category */

Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl.'/assets/DataTables-1.9.4/css/datatable.css');
Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl.'/assets/DataTables-1.9.4/js/jquery.dataTables.min.js',CClientScript::POS_END);
Yii::app()->clientScript->registerScript('example','
$(document).ready(function() {
    $("#example").dataTable({
         "aaSorting": [[ 0, "desc" ]],
         "sPaginationType": "full_numbers", 
         "sDom": "<'row'<'span8'l><'span8'f>r>t<'row'<'span8'i><'span8'p>>",
         "oLanguage": {
            "sUrl": "assets/DataTables-1.9.4/language/zh_CN.json"
         } 
    });
});
',CClientScript::POS_END);
?>

            <div class="col-md-2">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        操作选项
                    </div>
                    <div class="list-group">
                        <?php echo CHtml::link('类别列表',array('index'),array('class'=>'list-group-item')); ?> 
                        <?php echo CHtml::link('类别管理',array('admin'),array('class'=>'list-group-item')); ?> 
                    </div>
                </div>
            </div>
分享到
取消 提交回答
全部回答(1)

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题
推荐课程