Community & Support

theme_checkbox warning: implode() [function.implode]:

return theme_checkbox(array(
'title' => 'Title',
'value' => FALSE, 
'return_value' => 25, 
'description' => 'Test', 
'required' => FALSE
));

Why this code throws me the "warning: implode() [function.implode]: Invalid arguments passed" error?

Thanks

Comments

Solution

It's been a long while since the opening of this thread, but I was experiencing the same problem and found the solution after some debugging.

When using the theme_checkbox a references to the parent form is required. You have to set the #parents attribute. A little example:

theme_checkbox (
array (
"#id" => "one",
"#parents" => array(form][fieldset]")
)
)

Keep in mind that #parents must to be an array (as far as I noticed).

Some info about #parents can be found here.

Calling theme_checkbox() is

Calling theme_checkbox() is incorrect. Themeing functions should be called with the theme() function, and in this case, it would be theme('checkbox', $element);

Full-time freelancer, always looking for work.
jaypan.com (my portfolio)