Skip to content

How to access $_GET variables in plugins #3

@ttodua

Description

@ttodua

How to access $_GET variables in plugins, for example this doesnt work:

$dispatcher->addListener(Event\Radio\GenerateRawNowPlaying::class, function(Event\Radio\GenerateRawNowPlaying $event) {
    ...
    exit ( print_r($_REQUEST, true) );   //even `$_COOKIE` (or most of `$_SERVER`) variables are empty here, while outside they are working
    ...
	
 }, -1);

outputs empty Array() on player page ( example.com/public/my_station?param=abc ).
I want to get that param=abc $_GET variables.

___ UPDATE __
I've even tried to set $GLOBALS['MY_GET'] = $_GET['param']; or define('bla', $_GET['param']) in the top of plugin, and then use the globals inside events, neither it worked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions