use Piwik\Common; $id = Common::getRequestVar('id', '', 'int');
use Piwik\Common; $name = Common::getRequestVar('name', '', 'string');In this example, the getRequestVar() function is used to retrieve the 'name' variable sent via POST method. The second parameter is the default value that will be assigned if the variable is not found. The third parameter specifies the expected data type of the variable (in this case, a string). The getRequestVar() function is part of the Piwik Common package library, which provides a set of utility functions and classes for developers using the Piwik PHP API.