how set a variable from a module to plugin

47 views
Skip to first unread message

Viktor Iwan

unread,
Aug 20, 2012, 1:25:11 AM8/20/12
to joomla-de...@googlegroups.com
hello, i want to set a varible that will 'feed' the system plugin.

here's my plugin script that didn't work:

class plgsystemMyplugin extends JPlugin
{
    var $pattern;
    function disallow($arrScript){
            $this->pattern=$arrScript;
    }
    public function onBeforeRender()
    {
           var_dump($this->pattern);
    }
}

here's how i call in module:
plgsystemMyplugin::disallow("all");

This scheme is not working, but i hope you understand my problem. Any idea to solve this ?

Thanks


Martin Cooper

unread,
Aug 20, 2012, 6:49:56 AM8/20/12
to joomla-de...@googlegroups.com
Hi,
  you seem to be confusing static and non-static methods in your code, something like this seems to be what you want:

class plgsystemMyplugin extends JPlugin
{
    private static $pattern;

    public static function disallow($arrScript)
    {
            self::$pattern=$arrScript;
    }
    public function onBeforeRender()
    {
           var_dump(self::$pattern);
    }
}


Regards,
  Martin
Reply all
Reply to author
Forward
0 new messages