josegonzalez / cakephp-wysiwyg Goto Github PK
View Code? Open in Web Editor NEWCakePHP2: Unmaintained helper for various wysiwyg editors
License: MIT License
CakePHP2: Unmaintained helper for various wysiwyg editors
License: MIT License
Hi and first thanks for your plugin,
I wanted to use this in a project with CakePHP 2.1.2 but it seems like the Plugin doesn't implement the Helper Interface correctly. I'm not when exactly this changed (as far as I know it changed already with 2.0), but there are some problems now.
Just some of the problems I saw:
WysiwygHelper::__construct
is public function __construct($options)
but according to the docs this should be public function __construct(View $view, $options = array())
. The View object needs to be passed to the other helpers, too.WysiwygHelper.php
. The helpers are loaded via App::import()
(L82) and later they are assumed to be available as $this->$editorHelper
where $editorHelper
is the uppercase Editor name, i.e. Tinymce
. But they have never been initialized to this. Also, I think it would be better to use App::uses()
here instead of App::import
, but I'm not sure what would be the best way to do this.With kind regards,
Marc
hi, thanks for this plugin, I tried using it with CK editor but apparently it has some problems:
and the ckeditor.js is loaded, but it tries to initialize tinyMCE anyway in the field:
generates an element with id: "PostContent", but the plugin tries to initialize "#content"
because the field code doesn't wait for the editor to load.
thanks, best
Dan
First thanks for the all the work.
A couple issues (at least with the tinymce editor of the wysiwyg helper). First I assume on the textarea function you mean to set the option type to "textarea" not "textareas". But more importantly, on the section where you define adding or creating a class option you need to add space when you add to an option that has class already definee otherwise. Something like: $options['class'] .= ' ' . $selector;
Cakephp 2.2.5 - Tinymce 3.5.8
Controller
class PostsController extends AppController {
public $helpers = array('Html', 'Form', 'Session', 'Wysiwyg.Wysiwyg' => array('editor' => 'tinymce'));
View:
echo $this->Wysiwyg->input("Post.body");
Notice (8): Undefined index: model [APP/Plugin/Wysiwyg/View/Helper/TinymceHelper.php, line 65]
Code Context
TinymceHelper::input() - APP/Plugin/Wysiwyg/View/Helper/TinymceHelper.php, line 65
WysiwygHelper::input() - APP/Plugin/Wysiwyg/View/Helper/WysiwygHelper.php, line 106
include - APP/View/Posts/edit.ctp, line 10
View::_evaluate() - CORE/Cake/View/View.php, line 923
View::_render() - CORE/Cake/View/View.php, line 886
View::render() - CORE/Cake/View/View.php, line 476
Controller::render() - CORE/Cake/Controller/Controller.php, line 956
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 193
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 161
[main] - APP/webroot/index.php, line 92
Notice (8): Undefined index: field [APP/Plugin/Wysiwyg/View/Helper/TinymceHelper.php, line 65]
Code Context
TinymceHelper::input() - APP/Plugin/Wysiwyg/View/Helper/TinymceHelper.php, line 65
WysiwygHelper::input() - APP/Plugin/Wysiwyg/View/Helper/WysiwygHelper.php, line 106
include - APP/View/Posts/edit.ctp, line 10
View::_evaluate() - CORE/Cake/View/View.php, line 923
View::_render() - CORE/Cake/View/View.php, line 886
View::render() - CORE/Cake/View/View.php, line 476
Controller::render() - CORE/Cake/Controller/Controller.php, line 956
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 193
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 161
[main] - APP/webroot/index.php, line 92
in the usage documentation i think the line
public $helper = array('Wysiwyg.Wysiwyg' => array('editor' => 'fck'));
should be
public $helpers = array('Wysiwyg.Wysiwyg' => array('editor' => 'fck'));
It may help newcomers.
--Sujoy
hi, when I try to install this package, I get the following error:
The requested package josegonzalez/cakephp-page-route could not be found in any version, there may be a typo in the package name
thanks! best, dan
It's not possible to use the TinyMce on multiple textareas. The last one never loads. This is independent on how many there are. I've tried with 4 and 2. Last one is always a simple textarea.
In the Settings listing, when used inside the helper the indexes for the array should not be '_buffer' but 'buffer'.
Change in the doc or the code?
I tried all your recommended settings and receive this error. Can't find variable: tinyMCE when viewing the form. I am using cakephp 2.4.3
I am loading Wysiwyg like so in my controller:
public $helpers = array('Wysiwyg.Wysiwyg' => array('_editor' => 'Markitup'));
The _editor
option seems to be working fine for me - I can switch between the two editors I have tested. What does not seem to have an effect are any of the other options.
I would like to buffer the Markitup scripts instead of having them called in the header. I have tried setting _buffer
to true, but that doesn't seem to have an effect. I have also tried setting _scripts
to false, hoping that it would prevent the scripts from being loaded and I could then add them later in my view, but this also has no effect.
In going through the options and trying to change each one, _editor
is the only one I seem to get a response from.
Am I understanding or setting these options incorrectly?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.