I do a lot of ASP.NET MVC 2 development, but I'm tackling a small project at work and it needs to be done in PHP.
Is there anything built-in to PHP to do model binding, mapping form post fields to a class? Some of my PHP code currently looks like this:
class EntryForm
{
public $FirstName = "";
public $LastName = "";
}
$EntryForm = new EntryForm();
if ($_POST && $_POST["Submit"] == "Submit")
{
$EntryForm->FirstName = trim($_POST["FirstName"]);
$EntryForm->LastName = trim($_POST["LastName"]);
}
Is there anything built-in to a typical PHP install that would do such mapping like you'd find in ASP.NET MVC, or does it require an additional framework?