Witam,
Próbuję do Zend Framework 1 podpiąć FCKEditor lub TinyMCE i zarówno w jednym jak i drugim przypadku mam taki sam błąd:
Warning: Exception caught by form: Plugin by name 'FckEditor' was not found in the registry;
used paths: My_View_Helper_: C:\xampp\htdocs\cms\editor3\applicationMy/View/Helper/ Zend_View_Helper_: Zend/View/Helper/;
./views\helpers/;
C:/xampp/htdocs/cms/editor3/application/views\helpers/
Stack Trace:
#0 C:\php\ZendFramework-1.11.7\library\Zend\View\Abstract.php(1182): Zend_Loader_PluginLoader->load('FckEditor')
#1 C:\php\ZendFramework-1.11.7\library\Zend\View\Abstract.php(618): Zend_View_Abstract->_getPlugin('helper', 'fckEditor')
#2 C:\php\ZendFramework-1.11.7\library\Zend\Form\Decorator\ViewHelper.php(241): Zend_View_Abstract->getHelper('fckEditor')
#3 C:\php\ZendFramework-1.11.7\library\Zend\Form\Element.php(2023): Zend_Form_Decorator_ViewHelper->render('')
#4 C:\php\ZendFramework-1.11.7\library\Zend\Form\Decorator\FormElements.php(101): Zend_Form_Element->render()
#5 C:\php\ZendFramework-1.11.7\library\Zend\Form.php(2908): Zend_Form_Decorator_FormElements->render('')
#6 C:\php\ZendFramework-1.11.7\library\Zend\Form.p in C:\php\ZendFramework-1.11.7\library\Zend\Form.php on line 2929
Przykładowo FCKEditor robiłem w ten sposób:
Helper
utworzyłem library/My/View/Helper/FCKEditor.php
class My_View_Helper_FckEditor {
public function fckEditor($name = '', $value = '', $options = array())
{
include_once(APPLICATION_PATH. "/js/fckeditor/fckeditor.php");
$oFCKeditor = new FCKeditor($name);
$oFCKeditor->Config['EnterMode'] = ((isset($options['EnterMode'])) ? $options['EnterMode'] : 'p');
$oFCKeditor->ToolbarSet = ((isset($options['ToolbarSet'])) ? $options['ToolbarSet'] : 'User');
$oFCKeditor->BasePath = '/js/fckeditor/';
if(isset($options['Height'])) $oFCKeditor->Height = $options['Height'];
if(isset($options['Width'])) $oFCKeditor->Width = $options['Width'];
$oFCKeditor->Value = $value;
return $oFCKeditor->CreateHtml();
}
}
Element
utworzyłem library/My/Form/Element/FCKEditor.php
class My_Form_Element_FCKEditor extends Zend_Form_Element_Xhtml
{
public $helper = 'fckEditor';
}
utworzyłem plik library/My/Form:
class My_Form extends Zend_Form
{
public function __construct($options = null)
{
$this->addPrefixPath('My_Form_', '/My/Form/');
parent::__construct($options);
}
w metodzie init formularza:
class Application_Form_Form extends My_Form
{
public function init()
{
$this->addElement('fckEditor', 'txt', array(
'label' => 'Message',
'required' => true,
'cols' => '50',
'rows' => '10'
));
FCKEditor wrzucony do public/js
w application.ini dodane autoloadernamespaces[] = "My"
TinyMCE robiłem analogicznie wg wskazówek ze strony http://juriansluiman.nl/en/article/100/improved-tinymce-solution-for-the-zend-framework ale jest dokładnie ten sam problem.
w logu zastanawia mnie ten wpis:
used paths: My_View_Helper_: C:\xampp\htdocs\cms\editor3\applicationMy/View/Helper/
Slashe i Backslashe w ścieżce oraz brak rozdzielenia między application a My.
Czy to może być tutaj jakiś problem?