yii - php 字符串里面同时有 "" 和 ' ,本身又是字符串怎么办?
高洛峰
高洛峰 2017-04-10 14:37:57
0
2
671

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);
?>

            <p class="col-md-2">
                <p class="panel panel-default">
                    <p class="panel-heading">
                        操作选项
                    </p>
                    <p 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')); ?> 
                    </p>
                </p>
            </p>
高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
大家讲道理

加转义符“\”

大家讲道理

<?
$bar = <<<EOT
"foo's baba is bar & foo's mama is bug!"
EOT;

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template