开发者

Joomla Session Variable as Plugin Parameter

开发者 https://www.devze.com 2023-01-03 11:10 出处:网络
I have a Joomla plugin which takes varying parameters.I need to retrieve one of these parameters from the current session.I\'ve tried using Jumi and a little PHP snipped to retrieve the value and outp

I have a Joomla plugin which takes varying parameters. I need to retrieve one of these parameters from the current session. I've tried using Jumi and a little PHP snipped to retrieve the value and output it in the plugin's parameter list, but the Joomla plugin parser only handles the outter-most set of curly braces. ex.

{fabrik view=table id=62 rese开发者_C百科tfilters=1 fab_tours_ro___tour_id=[tour_id]}

[tour_id] I need to retrieve from the current session. I've tried

{fabrik view=table id=62 resetfilters=1 fab_tours_ro___tour_id={jumi [scripts/get_tour_id.php]}}

In that case the {jumi} tag never gets parsed. I could hack the {fabrik} plugin, but I'd prefer to do this without making any core or component changes, especially since I update Fabrik quite regularly via svn.


I actually ended up using the latest Jumi 2.1 beta plugin which runs as System rather than Content. Then it was as simple as echoing the plugin syntax with the value already filled in:

{jumi}
<?php
$tour_id = $mainframe->getUserState("tour_id", '0');
echo '{fabrik view=table id=62 resetfilters=1 fab_tours_ro___tour_id='.$tour_id.'}';
?>
{/jumi}


Make sure your jumi plugin is executing before your fabrik plugin. You can check the order they are being fired in Extensions -> Plugin Manager.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号