Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
wangta69 committed Oct 21, 2024
1 parent e5859d5 commit fdfdba2
Show file tree
Hide file tree
Showing 157 changed files with 31,398 additions and 17 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# NAVER SMART Editor for Laravel
# Wizwig Editor for Laravel
> 현재 배포중인 에디터들을 라라벨에서 바로 사용할 수 있게 처리된 플러그인
## 제공 Editor
- Naver Smart Editor
- Froala Editor
## document

[공식사이트](https://www.onstory.fun/doc/programming/laravel/package.laraveleditor)
Expand All @@ -12,8 +16,8 @@ php artisan pondol:install-editor
```

## Tests
> goto https://yourdomain/editor/smart-editor
> for naver smart edigor : https://yourdomain/editor/smart-editor
> for naver smart edigor : https://yourdomain/editor/froala
## Ex
### before
Expand All @@ -24,12 +28,20 @@ php artisan pondol:install-editor
</form>
```
### after
#### naver smart editor
```
<form>
@include ('editor::smart-editor.editor', ['name'=>'comment', 'id'=>'comment-id', 'value'=>'', 'attr'=>['class'=>'']])
<button type="submit">Save</button>
</form>
```
#### froala editor
```
<form>
@include ('editor::froala.editor', ['name'=>'comment', 'id'=>'comment-id', 'value'=>'', 'attr'=>['class'=>'']])
<button type="submit">Save</button>
</for
![laravel WYSIWYG editor](./assets/images/editor-sample.png)
- for more [visit](https://www.onstory.fun/doc/programming/laravel/package.laraveleditor)
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wangta69/laravel-editor",
"description": "Naver SmartEditor for laravel",
"keywords": ["laravel", "smarteditor", "WYSIWYG", "pondol", "naver", "네이버", "스마트에디터", "라라벨"],
"description": "WysiWig Editors for laravel",
"keywords": ["laravel", "WYSIWYG", "Editor","froala", "naver", "네이버", "스마트에디터", "라라벨"],
"homepage": "https://www.onstory.fun/doc/programming/laravel/package.laraveleditor",
"license": "MIT",
"authors": [
Expand Down
53 changes: 53 additions & 0 deletions src/Http/Controllers/FroalaEditorController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php
namespace Pondol\Editor\Http\Controllers;

use Illuminate\Http\Request;
use Pondol\Editor\Traits\SmartEditor;

use App\Http\Controllers\Controller;
class FroalaEditorController extends Controller
{

use SmartEditor;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
}

public function create()
{
$data = $this->_create();
return view('editor::froala.sample', $data);
}

public function store(Request $request) {
$pattern = '|(<p data-f-id)(.*)/p>|';
// preg_match_all($pattern1, $request->editor_content, $matches);
// print_r($matches);

$editor_content = preg_replace($pattern, '', $request->editor_content);
echo $editor_content;
}

public function upload()
{
return view('editor::smart-editor.photo-upload', []);
}

public function uploadStore(Request $request) {
$result = $this->_uploadStore($request);
if($result['error']) {
return redirect($result['error']);
}
return $result['url'];
}

public function uploadStoreHtml5(Request $request) {
return $this->_uploadStoreHtml5($request);
}

}
48 changes: 48 additions & 0 deletions src/Http/Controllers/SmartEditorController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
namespace Pondol\Editor\Http\Controllers;

use Illuminate\Http\Request;
use Pondol\Editor\Traits\SmartEditor;

use App\Http\Controllers\Controller;
class SmartEditorController extends Controller
{

use SmartEditor;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
}

public function create()
{
$data = $this->_create();
return view('editor::smart-editor.sample', $data);
}

public function store(Request $request) {
print_r($request->all());
}

public function upload()
{
return view('editor::smart-editor.photo-upload', []);
}

public function uploadStore(Request $request) {
$result = $this->_uploadStore($request);
if($result['error']) {
return redirect($result['error']);
}
return $result['url'];
}

public function uploadStoreHtml5(Request $request) {
return $this->_uploadStoreHtml5($request);
}

}
2 changes: 1 addition & 1 deletion src/Traits/SmartEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
trait SmartEditor
{

public function _main()
public function _create()
{
$data = new \stdclass;
$data->ir1 = '<p>서버의 데이타는 이렇게 호출됩니다';
Expand Down
Loading

0 comments on commit fdfdba2

Please sign in to comment.