Skip to content

Commit e5b9b3c

Browse files
committed
feat: update plugin config format
1 parent d0e004e commit e5b9b3c

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# cakephp-tinymce plugin for CakePHP 4.x
2-
Tinymce 4 for cakephp 4.x
2+
TinyMCE 5 for CakePHP 4.x
33

44
## Installation
55

@@ -21,16 +21,14 @@ At the end of config/boostrap file
2121
With your own configuration, create file config/tinymce.php ex:
2222

2323
<?php
24-
use Cake\Routing\Router;
25-
2624
return [
2725
'Trois/Tinymce' => [
28-
'height' => '500',
26+
'height' => 500,
2927
'language' => 'fr_FR',
30-
'language_url' => 'https://static.3xw.ch/tinymce/lang/fr_FR.js',
28+
'language_url' => 'https://static.3xw.ch/tinymce/5.1/lang/fr_FR.js',
3129
'menubar' => false,
32-
'plugins' => ['advlist autolink lists link charmap print preview searchreplace visualblocks code fullscreen emoticons insertdatetime table contextmenu paste code help wordcount'],
33-
'toolbar' => 'attachment | insert | undo redo | formatselect | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist | emoticons | code | removeformat ',
30+
'plugins' => 'advlist autolink lists link charmap print preview searchreplace visualblocks code fullscreen emoticons insertdatetime table paste code help wordcount',
31+
'toolbar' => 'undo redo | link | formatselect | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist | emoticons | code | removeformat',
3432
'block_formats' => 'Paragraphe=p;Titre 1=h1;Titre 2=h2;Titre 3=h3',
3533
'formats' => [
3634
'bold' => ['inline' => 'strong'],
@@ -41,7 +39,11 @@ With your own configuration, create file config/tinymce.php ex:
4139
],
4240
'valid_elements' => '*[style],p[style],strong,em,i,u,del,a[href|target],ul,ol,li[style],table,th,td[style],tr,img[src|style|class|alt|width|height]',
4341
'valid_styles' => ['*' => 'text-align,color'],
44-
'content_css' => []
42+
'content_css' => [],
43+
'theme' => 'silver',
44+
'mobile' => [
45+
'theme' => 'silver',
46+
]
4547
]
4648
];
4749

@@ -52,6 +54,7 @@ In your view files:
5254
'field' => 'content',
5355
'value' => $post->content,
5456
'init' => [ // optional
55-
'some_settings' => 'coucou',
56-
'toolbar' => 'code | removeformat ', // override settings and add only code & removeformat
57+
'height' => 300,
58+
'toolbar' => 'undo redo | bold italic | code | removeformat', // override default toolbar
59+
]
5760
]);

config/tinymce.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
'language' => 'fr_FR',
66
'language_url' => 'https://static.3xw.ch/tinymce/5.1/lang/fr_FR.js',
77
'menubar' => false,
8-
'plugins' => ['attachment advlist autolink lists link charmap print preview searchreplace visualblocks code fullscreen emoticons insertdatetime table paste code help wordcount'],
9-
'toolbar' => 'attachment | insert | undo redo | links | formatselect | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist | emoticons | code | removeformat ',
8+
'plugins' => 'attachment advlist autolink lists link charmap print preview searchreplace visualblocks code fullscreen emoticons insertdatetime table paste code help wordcount',
9+
'toolbar' => 'attachment undo redo | link | formatselect | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist | emoticons | code | removeformat',
1010
'block_formats' => 'Paragraphe=p;Titre 1=h1;Titre 2=h2;Titre 3=h3',
1111
'formats' => [
1212
'bold' => ['inline' => 'strong'],

0 commit comments

Comments
 (0)