$app->get( '/article', function () use ($app) {
$factories = shuffle(['Article', 'Book']);
$factory = array_shift($factories);
$items = Model::factory($factory)->order_by_desc('id')->limit(2)->find_many();
$factory = strtolower($factory);
return $app->render('home.html', array("{$factory}s"=>$items));
...
location ~ /images/w/norm/([0-9]{2,4})/([0-9,a-z,A-Z,-_]{3})([0-9,a-z,A-Z,-_]+)\.jpg {
rewrite ^/images/([0-9]{2,4})/([0-9,a-z,A-Z,-_]+)\.jpg$ /media.php?size=$1&id=$2&image=square;
}