I have been working with Zend for a few months now and am at a stage where I'd like to add some fields to my form using TinyMce. What I want to achieve is to be able to just create a form extending Zend_form and just be able to say
$element = new TinyMce_Form_Element_Editor('element');
But I just do not have a single clue on how to achieve this. I have of course been looking around before asking this question and most sources just point me towards this site.
Which seems to be aimed at people with a lot of experience with Zend. 2 months in it's not a big surprise I am not at the level this might have been intended for as I have tried following the instructions given and creating the file setup as shown by in the svn repository create by the writer of this article.
Aside from heading from one error into another I also do not understand what the code is doing exactly, I just have a vague guess at best when I run through it.
Is there any kind of easy to follow simple tutorial explaining how to enable tinymce in a Zend Form?
Any advice or tips on how to achieve my goal will be well appreciated
Not best solution but you may find it useful:
class My_Form_Element_Tinymce extends Zend_Form_Element_Textarea
{
/**
* Element CSS class name
* @var string
*/
protected $class = 'tinyMCE';
public function init()
{
$this->getView()->headScript()->appendFile('path/to/tinymce.js');
$this->getView()->headScript()->appendFile('path/to/tinymce_config.js');
}
}
and in your tinymce_config.js
add selector for tinyMCE
class name
tinymce_config.js
is your tinyMCE configuration file if you never used tinyMCE goto http://tinymce.com and you will find many examples with what you need.