I recently discovered the excellent redbean ORM library for PHP, which makes performing CRUD operations trivial in my web application, but I recently implemented some additional functionality that I'm starting to question. To make saving data even easier, I created a procedural form-processing script called redbean.php. Whenever this script is specified as the form action, it will create a new bean dynamically based on the data submitted to it:
<?php Template::startContent(); ?>
<form action="forms/redbean.php" method="POST">
<input type="hidden" name="bean" value="book"/>
<input type="text" name="author"/>
<input type="text" name="pubDate"/>
<input type="submit" value="Save Bean!"/>
</form>
<?php Template::endContent(); ?>
The reason I'm starting to question this approach is because everything else in my framework uses the MVC pattern, but this feels like cheating because the data is going straight from the view to the ORM library. Anyways, I'm trying to implement this application using best practices for PHP and web programming in general, so my question is whether or not this approach represents an anti-pattern that I'm not aware of, or if there is anything else I should consider with this implementation.