Hi
The Helper class has some good method for all that :
http://api.cakephp.org/class_helper.html
For exemple $helper->value(), which you can call, in your case, with
$fckeditor->value(), as your helper likely extends the main Helper
class...
I often use $helper->__initInputField('fieldname') also, inside my
custom helpers, to generate the base input options array containing
value(), name, id, and form validation infos.
By the way, I don't know how you implemented the fckEditor thing, but
there are several tutorial on the web that rely on creating basic
input/text tags (generated by formhelper), and transforming them to
html editors afterwards through javascript with fckeditor... I've
personnally found this method cleaner than rewriting code from
formhelper.
Hope it helps...
+++++++
Clément
On Thu, May 29, 2008 at 11:37 AM, Somesid <[EMAIL PROTECTED]> wrote:
>
> Ok, can't figure if it's wrong or not, so I'm gonna ask the question
> here:
>
> I made a new fckEditor helper to handle some problematic of our own.
> The thing it does is that it instantiate an fckEditor named after the
> field like any other cake field (data[model][field]).
>
> So we got a display function like this to create our fckEditor field
> public function display($instance_name = '', $default_value = '',....)
>
> which we call in the form like this
> echo $fckeditor->display('model.field',$text,...)
>
> My difficulties come to setting the value, first way we made this work
> was like this (in the helper):
> $this->_o_EditorInstance->Value = $text; //set the value in the
> textarea of the fckeditor
>
> and then in the controller:
> set($text, $this->data['model']['field']);
>
> All of this is working well, but I don't like the idea of having to
> set my value any time I got a fckEditor in a form for a field which is
> for me like any other. So what I noticed is that I was able to access
> directly $this->data['model']['field'] in my view or my helper which
> gets me to :
>
> $this->_o_EditorInstance->Value = $this->data['model']['field']; //I'm
> here in the helper
>
> I got ride off my $text, It's working well, I'm happy, but I'm afraid
> I'm going against the way cake works. And anyway it bother me, what
> would be wrong about accessing directly $this->data in a view, when it
> has been properly and cleanly set in the controller (As long as we
> only read values of our form from $this->data, as probably cake reads
> the data to set the value for a standard input).
>
> Hopes it's clear enough. Thx for your help.
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---