summernote 사용법

HSGemini·2022년 3월 2일
0

공부

목록 보기
2/3

https://summernote.org/getting-started/#simple-example

editor.php

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <!-- include libraries(jQuery, bootstrap) -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>

<!-- include summernote css/js -->
<link href="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"></script>



<script>
$(document).ready(function() {
	//여기 아래 부분
	$('#summernote').summernote({
		  height: 300,                 // 에디터 높이
		  minHeight: null,             // 최소 높이
		  maxHeight: null,             // 최대 높이
		  focus: true,                  // 에디터 로딩후 포커스를 맞출지 여부
		  lang: "ko-KR",					// 한글 설정
		  placeholder: '최대 2048자까지 쓸 수 있습니다'	//placeholder 설정
          
	});
});
</script>
</head>
<body>


<form method="post" action="editorProc.php">
<table >
<tr>
    <td>제목</td>
    <td><input type="text" name="subject"></td>
</tr>
<tr>
    <td colspan="2">
    <textarea id="summernote" name="memo"></textarea>
    </td>
</tr>
</table>
<input type="submit" value="전송" >

</form>
</body>
</html>

editorProc.php


<?php
//xmp 한줄씩 보기좋게
echo "<xmp>";
print_r($_POST);
?>

profile
공부중

0개의 댓글