Hi,
In my projects using FCKEditor, I created a View's Helper that renders FCK
Editor.
I just applied or not this helper on a Zend_Form_Element_Textarea to use
FKCeditor.
My View's Helper is :
/**
* Constructor
*
* @access public
* @param string $xhtml balise textarea
* @param string $id ID de la balise textarea
* @return string
*/
public function TextareaFCK($xhtml, $id)
{
return $xhtml . '<script type="text/javascript"> $(function(){
$(\'textarea#'.$id.'\').fck({path: \'/fckeditor/\',
toolbar:\'Toolbar_Name\', width:\'520px\', height:\'300px\'}); });
</script>';
}
In a view :
<?php echo $this->TextareaFCK($this->form->getElement('nameField'), '
nameField '); ?>
I.E. : I use JQuery's FCKEditor version.
Hope it's help.
Regards,
Guillaume BABIK
INTERNIM
45, rue Aristide Briand
92300 LEVALLOIS
<BLOCKED::http://www.internim.com/> http://www.internim.com
-----Message d'origine-----
De : drj201 [mailto:[EMAIL PROTECTED]
Envoyé : vendredi 26 septembre 2008 15:42
À : [email protected]
Objet : [fw-general] FCKEditor and Zend_Form integration
Hi all,
I want to integrate FCKEditor (WYSIWYG) into a Zend_Form thus bringing all
the benefits that allows...
Note: Im not talking of simply getting FCKEditor to work in the view etc
(ala here:
http://blog.ekini.net/2007/11/28/using-fckeditor-with-zend-framework-file-br
owser-enabled/#comments)
but actually integrating it into Zend_Form.
Has anyone done this before? What would be your recommended approach? Is it
even possible without investing 100's of man hours and hacking the
framework to death? :-(
I first thought of simply dumping the HTML required by FCKEditor into a
decorator but this is not the answer.
I then thought of creating a new Zend_Form_Element and overwriting the
render method to simply return the HTML like so:
public function render(Zend_View_Interface $view = null)
{
$oFCKeditor = new FCKeditor_FCKeditor('FCKeditor1');
$oFCKeditor->BasePath = '/js/FCKeditor/';
$oFCKeditor->Value = $this->getValue();
return $oFCKeditor->CreateHtml();
}
Neither of the above provide any real integration with Zend_Form however!
Using the above method for example it is not possible to wrap the element in
Decorators or add a Label. It also doesnt provide integration when using
$form->getValues(). The FCKEditor form field only shows in $_POST.
Maybe a ViewScript Decorator is the answer? Wait for the Editor Dijit (even
though it is nowhere as comprehensive)?
What would you guys suggest?
Regards,
David
--
View this message in context:
http://www.nabble.com/FCKEditor-and-Zend_Form-integration-tp19688738p1968873
8.html
Sent from the Zend Framework mailing list archive at Nabble.com.