1

Is there any difference between times that I define libraries in theme or module level with times that I use Libraries API module instead?
Is it necessary to use library module and I add/attach my libraries to it?
What's real purpose and usage of the Libraries API module?

0

1 Answer 1

4

The real purpose of Libraries API module is to serve as a central point of information about libraries, so modules can rely on this module to request loading libraries. This avoids modules to include libraries in their module package and just ask Drupal for them.

The main advantage is it avoids conflicts and duplication between several modules shipping same library. With this module, both modules declare the need of a certain library, that should be installed in the Drupal librarires directorty.

Also, modules don't need to include code to detect and load the libraries, version detection, etc

See The ideas and design behind Libraries API 2.x for a detailed explanation.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.