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 -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -