Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/253.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在表的每一行上显示CKEditor_Php_Codeigniter_Ckeditor - Fatal编程技术网

Php 在表的每一行上显示CKEditor

Php 在表的每一行上显示CKEditor,php,codeigniter,ckeditor,Php,Codeigniter,Ckeditor,我希望CKEditor显示在表的每一行上,但它只显示在第一行上。在其他行上,只显示textarea,不显示CKEditor。我使用Codeigniter。这是我的观点: <?php foreach ($query as $row) { echo "<table border='1'>"; echo "<tr>"; ?> <td class='col-md-2'> <textarea name="con

我希望CKEditor显示在表的每一行上,但它只显示在第一行上。在其他行上,只显示textarea,不显示CKEditor。我使用Codeigniter。这是我的观点:

<?php
foreach ($query as $row) {
    echo "<table border='1'>";
    echo "<tr>";
    ?>
    <td class='col-md-2'>
    <textarea  name="content" id="content"></textarea> 
    <?php 
    echo display_ckeditor($ckeditor);
    ?>
    </textarea></td></tr>
    <?php
}
?>

我的控制器是:


尝试动态提供id,而不是“内容”

****Download ckeditor from here :** 
(基本包装)

**代码**:-
带有jQuery的编辑器
$(函数(){
$('.content').ckeditor();
});             
带有jQuery的编辑器









**文件夹结构**(在xampp/htdocs中,我创建了一个文件夹名stackoverflow):-

如何动态提供id?试试这个,'id'=>'content',我在控制器中更改了它,但仍然没有效果。在控制器中,放置'id'=>'content'。rand()在视图中放置id='content'是相同的,只是第一行是CKEditor,和下一个textarea.use class而不是ID。。因为它会在while循环中创建ID重复..非常感谢,我现在就试试。我创建了文件夹结构,这没有问题:)我不能,因为我没有15个声誉。哦,试着挣钱,然后再做。:::)没问题。:)
**Code**:-
<html>     
<head>           
<title>CKEditor with jQuery</title>         
<!-- JQUERY LIBRARY -->         
<script type="text/javascript" src="jquery-1.9.1.js"></script>    
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>          
<script type="text/javascript" src="ckeditor/adapters/jquery.js"></script>    
<script type="text/javascript">                               
$(function(){                                            
$('.content').ckeditor();                             
});             
</script>       
</head>     
<body>         
    <h1>CKEditor with jQuery</h1>         
        <form id="editor_form" method="post" action="index.html">             
            <textarea class = "content"></textarea><br>         
            <textarea class = "content"></textarea><br>          
            <textarea class = "content"></textarea><br>          
            <textarea class = "content"></textarea><br>          
            <textarea class = "content"></textarea><br>          
            <textarea class = "content"></textarea><br>          
            <textarea class = "content"></textarea><br>          
            <textarea class = "content"></textarea><br>          
            <textarea class = "content"></textarea><br> 
        </form>
</body> 
</html>

**Folder Structure** (in xampp/htdocs i have created a folder name stackoverflow):-