0

I am new to Joomla (a seasoned WP dev) and I have just barely managed to wrap my head around the components and the plugins.

The thing is, that I want to include a shared component (a class), that should be callable from both the component and the plugin.

Any ideas? A library maybe? Can I bundle a library in a Joomla installer Package in this case?

Dzhuneyt
  • 8,437
  • 14
  • 64
  • 118

1 Answers1

3

If you create a lib_yourlib.xml file in the root directory and specify :

<extension type="library">
<files folder="yourlib">

it should be installable like any package, and it will be copied in libraries/yourlib after installation.

epicdev
  • 922
  • 4
  • 10
  • That is inside the root directory of a component or a plugin? – Dzhuneyt Apr 08 '13 at 11:34
  • I mean where should I put the library installation, not where it will go aftewards. Basically, should I put a library inside the plugin or inside the component? – Dzhuneyt Apr 08 '13 at 11:42
  • You can create a library package like mentionned above and install it together with your component / plugin. It will be installed in `libraries/your_lib` and you can use it in the component and plugin from there. If your plugin doesn't work without the component, then you can put it in the component. – epicdev Apr 08 '13 at 11:48