This page has some useful documentation:

http://www.symfony-project.org/book/forms/1_2/en/A-Widgets#chapter_a_sub_sfwidgetformtextareatinymce

It gives this example:

$w = new sfWidgetFormTextareaTinyMCE(
  array(),
  array('class' => 'foo')
);

It doesn't mention that "class" is required, but that is okay, since
the error message seems to be clear. However, it is still not working.
If I do this:

    $this->widgetSchema['description'] = new
sfWidgetFormTextareaTinyMCE(array(
                  'width'  => 550,
                  'height' => 350,
                ),
                array('class' => 'bocahoops_textarea')
        );

I get this error:

[InvalidArgumentException]
You must pass a "class" attribute for a TinyMCE widget (new_news
[description]).


And if I do this:

    $this->widgetSchema['description'] = new
sfWidgetFormTextareaTinyMCE(array(
                  'width'  => 550,
                  'height' => 350,
                  'class' => 'bocahoops_textarea'
                ),
                array('class' => 'bocahoops_textarea')
        );

I get this error:

[InvalidArgumentException]
sfWidgetFormTextareaTinyMCE does not support the following options:
'class'.


If I go back to this:

    $this->widgetSchema['description'] = new
sfWidgetFormTextareaTinyMCE(array(
                  'width'  => 550,
                  'height' => 350,
                ),
                array('class' => 'bocahoops_textarea')
        );

I am puzzled by this part of the error message:

at sfWidgetFormTextareaTinyMCE->render('new_news[description]', 'Davy
Johnson, now a Junior, shows great promise. ', array(), null)

It clearly shows the second array as empty, even though my code
clearly shows that I've added the class to the second array.

What am I getting wrong here?

--- lawrence









On Mar 3, 11:42 pm, Lawrence Krubner <lkrub...@geocities.com> wrote:
> If you go here:
>
> http://www.symfony-project.org/blog/2008/10/18/spice-up-your-forms-wi...
>
> then you see this as an example:
>
> $this->widgetSchema['content'] = new sfWidgetFormTextareaTinyMCE(array
> (
>   'width'  => 550,
>   'height' => 350,
>   'config' => 'theme_advanced_disable: "anchor,image,cleanup,help"',
> ));
>
> So I put this into my code (into NewNewsForm.class.php):
>
>     $this->widgetSchema['description'] = new
> sfWidgetFormTextareaTinyMCE(array(
>           'width'  => 550,
>           'height' => 350,
>           'config' => 'theme_advanced_disable: "anchor,image,cleanup,help"',
>         ));
>
> and I refresh the browser that is pointing to the form page, and I get
> this error:
>
> [InvalidArgumentException]
> You must pass a "class" attribute for a TinyMCE widget (new_news
> [description]).
>
> stack trace at () in SF_ROOT_DIR/plugins/sfFormExtraPlugin/lib/widget/
> sfWidgetFormTextareaTinyMCE.class.php line 60 ...
>   {
>     if (!isset($attributes['class']))
>     {
>       throw new InvalidArgumentException(sprintf('You must pass a
> "class" attribute for a TinyMCE widget (%s).', $name));
>     }
>     $textarea = parent::render($name, $value, $attributes, $errors);
> at sfWidgetFormTextareaTinyMCE->render('new_news[description]', 'Davy
> Johnson, now a Junior, shows great promise. ', array(), null)
> in SF_SYMFONY_LIB_DIR/form/sfFormField.class.php line 117 ...
>
> I'm using Symfony 1.1.4
>
> Does anyone have a clue why this is happening?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to