#attached['library'] needs to be documented in the FAPI doc.

Comments

rfay’s picture

Assigned: Unassigned » rfay
rfay’s picture

Issue tags: +FAPI reference
jhodgdon’s picture

Project: Documentation » Drupal core
Version: » 7.x-dev
Component: Correction/Clarification » documentation

If this is about the FAPI reference, shouldn't it be in the Core issue queue?

jhodgdon’s picture

Project: Drupal core » Documentation
Version: 7.x-dev »
Component: documentation » API documentation files
Assigned: rfay » Unassigned

FAPI reference file is in the Documentation project now.

jn2’s picture

Status: Active » Needs review

The #attached description already mentions 'library' as an option, so I'm guessing you want to add a usage example. Here's one from contact.pages.inc:

 if (!$user->uid) {
    $form['#attached']['library'][] = array('system', 'jquery.cookie');
    $form['#attributes']['class'][] = 'user-info-from-cookie';
  }

I can also add a link to drupal_add_library.

sven.lauer’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. And yes, I think a link to drupal_add_library would be good.

jhodgdon’s picture

Issue tags: +valid issue

Tagging so #1421874: [meta] Documentation Issue Queue Cleanup doesn't have to look at API docs issues.

jn2’s picture

Title: FAPI Reference never got #attached['library'] » FAPI Reference need additional documentation for #attached['library']
Status: Reviewed & tested by the community » Fixed

This is fixed for D7 and D8.

Status: Fixed » Closed (fixed)
Issue tags: -FAPI reference, -valid issue

Automatically closed -- issue fixed for 2 weeks with no activity.