how can I include a custom library in Drupal ?
For example I need to insert this statement somewhere, to use the dompdf library:
require_once("dompdf_config.inc.php");
Once the this file is included, i can trigger custom php code from my drupal 开发者_如何学运维back-end custom actions.
thanks
You want to include it, in order to use it, not?
If so, just include it at the place where you are going to use it.
E.g. in your own dompdf.module
.
. That module would then distribute the dompdf funcitonality trough your Drupal site.
Another, common route is to place the include in /sites/all/libraries/
and then to include it from your dompdf.module
.
libraries in /sites/all/libraries/
are often libraries that will be used in more then only your module: probably in your theme too, or in other modules too.
2 Places to do it would be
- In a module's
.module
file, if you always want it included - Wrapped in a function that you can call, if you manually want to include it.
精彩评论