|
Hi James, Code below just works, no need for events to attach. Bart /*text field*/ $fck = new SpaceCMS_Form_Element_Fck('text'); $fck->setLabel('text'); $this->addElement($fck); /*class:*/ <?php require_once(WEBROOT.'/fckeditor/fckeditor.php'); class SpaceCMS_Form_Element_Fck extends Zend_Form_Element_Textarea{ /[EMAIL PROTECTED]: use a custom decorator instead of overriding render. * You will have to add some kind of prefix path in order to be able to set the decorator property */ /** * Render form element * * @param Zend_View_Interface $view * @return string */ public function render(Zend_View_Interface $view = null) { if (null !== $view) { $this->setView($view); } $oFCKeditor = new FCKeditor($this->getName()) ; $oFCKeditor->BasePath = BASEURL.'/fckeditor/' ; $oFCKeditor->Height = 300; $oFCKeditor->Value = $this->getValue(); $content = $oFCKeditor->CreateHtml(); $this->removeDecorator('ViewHelper'); foreach ($this->getDecorators() as $decorator) { $decorator->setElement($this); $content = $decorator->render($content); } return $content; } } james_fortune schreef: Hello, I am currently creating a cms. A text area on each page of the site will be editable via fck editor however I am not sure how to put fck editor into a form and save the content back to the database.I have been trying to do this for a while now and am getting nowhere so anyhelp would be greatly appreciated. Thank You --
|
- [fw-general] Integrating FCKEditor with Zend_Form james_fortune
- Re: [fw-general] Integrating FCKEditor with Z... Matthew Weier O'Phinney
- Re: [fw-general] Integrating FCKEditor wi... james_fortune
- Re: [fw-general] Integrating FCKEditor with Z... Bart McLeod
- Re: [fw-general] Integrating FCKEditor wi... james_fortune
- [fw-general] Integrating FCKEditor with Zend_... Julian102

