I'm a beginner in Joomla and a little confused with this method.
for example consider this :
where is the source of
JInput->get() get's inputs from where ?
Joomla Stack Exchange is a question and answer site for Joomla! administrators, users, developers and designers. It only takes a minute to sign up.Sign up to join this community
foo are the PHP superglobals such as $_POST or $_GET. So it's data what the user submits via a form, URL or cookie to your component.
So you are receiving in a safe way a parameter that was sent to you via a HTTP method.
$myVar = $app->input->get('foo',0,'int');
is largely equivalent to:
$myVar = (int) $_REQUEST['foo'];
You should always use JInput, no matter what. You just forget about the PHP superglobals. Read the whole documentation in silence, you should know it by heart.