Hi friends,
I am using a plugin for displaying data according to the {segment_2} But now i want to take the value of the {segment_2} inside my plugin to process my Query.
example : function test(“Here comes my {segment_2} value)
Can i do that?
Please guide me through this
Thanks, Davmit
[Moderator Edit: Moved to Plugin Technical Assistance forum]
or, if you plan on using the plugin on other templates where you might be checking on segment 3/4/5 etc:
On template:
{exp:my_plugin my_parameter="{segment_2}"}
etc...
{/exp:my_plugin}
And within the plugin:
global $TMPL;
$my_parameter = $TMPL->fetch_param('my_parameter');
It’s right there for you …global $IN; $segment_1 = $IN->SEGS[1]; $segment_2 = $IN->SEGS[2]; ...
Might want to either check that $IN->SEGS[#} is set before calling it directly, or simply use $IN->fetch_uri_segment()
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.