fat free framework - PHP F3 find escaping limit and offset conditions -


i introduced php fat free framework yesterday , exploring possibilities rest api. trying select query limit , offset parameters. following documentation, came following:

$query = array('userid=?', f3::get('userid')); $extra = array(     'order'     =>'id desc',     'offset'    => isset($_get['offset']) ? (int)$_get['offset'] : 0,     'limit'     => isset($_get['limit']) ? (int)$_get['limit'] : 5 ); $list = $this->mapper->find($query, $extra); 

however, while under impression f3 handle escaping, doesn't. using framework in wrong way, or how should handle escaping here?

instead of using find() should use paginate() this:

$list = $this->mapper->paginate(2, 5, array('userid=?', f3::get('userid'))); 

check out docs, it's quite easy use. result different find(), though, since contains more info. items returned in $list['subset']. can var_dump of $list see other fields returned.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -