I've set up my model to handle pagination and had a question about how I should handle bad input. Suppose my url is constructed as controller/action/key/value and I am passing the user param 'page' to my model which then uses it to set up fetchAll($select()->limitPage($page, $length)). When the (int) value of $page is < 1, the result set returned corresponds to page 1. However, when the (int) value of $page is greater than the range of the result set, an empty rowset object is returned. My question is, should I allow the default behavior, even though it results in malformed urls returning result sets OR should I throw a 404 when a user enters bad input data? I guess this is a personal choice, but I am looking for a best practice solution. Thanks.
Regardless, of your suggestion, does ZF have a built in method to quickly throw a 404 or do I have to handle errors through my ErrorController (assuming the plugin is set up)? Thanks. -- View this message in context: http://www.nabble.com/Question-about-pagination-tp16392201p16392201.html Sent from the Zend Framework mailing list archive at Nabble.com.
