Skip to content

Instantly share code, notes, and snippets.

@phproberto
Last active December 17, 2015 12:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phproberto/5611384 to your computer and use it in GitHub Desktop.
Save phproberto/5611384 to your computer and use it in GitHub Desktop.
Retrieve JForm post data with JInput
<?php
// Required objects
$input = JFactory::getApplication()->input;
// Get the form data
$formData = new JRegistry($input->get('jform', '', 'array'));
// Get any data being able to use default values
$id = $formData->get('id', 0);
$name = $formData->get('name', null);
$email = $formData->get('email', null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment