backdrop-ops / docs.backdropcms.org

Website for displaying Backdrop CMS documentation and API source code.
https://docs.backdropcms.org/
6 stars 6 forks source link

FAPI: Document that form also accepts #attached #218

Closed avpaderno closed 1 year ago

avpaderno commented 1 year ago

https://docs.backdropcms.org/form_api#special-elements does not report that #attached can be used with a form, despite code like the following one is correct.

$form['#attached']['js'] = array(
  backdrop_get_path('module', 'ajax_example') . '/ajax_example.js',
);

With that code, #attached is added directly to $form, not a form element. #attached should show a checkmark also for form.

bugfolder commented 1 year ago

Thanks, @kiamlaluno! Fixed.