New: Learn Statamic on Laracasts!

We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Get $_POST['item'] within a Plugin?

Nico del Castillo September 18, 2014 by Nico del Castillo

Not really sure about this from the documentation, but is there a way to grab $_POST data from a form on a page within a plugin?

Ordinary PHP looks like this:

<?php
public function item1(){
  $item1 = $_POST['item1'];
  return $item1;
}
?>

The only way I can get it to work is if I call $_POST from within the template, but I'd like to call it via the plugin.

Answered by Jason Varga!
>>>>>>> Answered <<<<<<<
6 Replies
1 Follower