A cursory look shows this hasn’t been brought up before, apologies if it has.
I’m working on a custom plugin for my website, and I’d like to use some established code, namely the ImageSizer plugin to process the images I’m getting back. Is there a way to essentially call a plugin from a plugin? This is my first venture into extending EE the “official” way, so any pointers would be great.
Sure, have a look at the parse= parameter to make sure that they are parsed in the order you need them to be.
That looks like a step in the right direction, but it looks to be more about nesting different plugin tags, e.g
{exp:magpie url="http://some-site.com" parse="inward"}
{items}
<a href="http://{link}">{title}</a>
{exp:word_limit total="20"}{content}{/exp:word_limit}
{/items}
{/exp:magpie}
I was thinking something with tighter integration, where I’m directly calling the functionality of the ImageSizer plugin from my plugin code, so I could have something like:
{exp:lastfm:quilt user="tesfox" rows="5" cols="3"}
To use in my templates.
You just need to call the class you need a la
if ( ! class_exists('Class_name'))
{
require PATH_PI.'pi.class_name'.EXT;
}
Then you’d use the function you need a la
$PLUG = new Class_name;
$PLUG->function();
Er- roughly. Make sense? You can then use the functions from the class you called.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.