AMP (Accelerated Mobile Pages)


#1

Hi guys, I would like to know what is the best way so that when passing a parameter by URL the web optimized for AMP is displayed. I’m trying with:

$app->get('/aaaaaa[/[{type}]]', function ($request, $response, $args) use ($settings) {
   $a_params = [
    ];
    if ($args['type'] == 'amp') {
         // AMP THEME
         return $this->view->render($response, 'aaaa.html.twig', $a_params);
    } else {
         // NORMAL THEME
         return $this->view->render($response, 'aaaa.html.twig', $a_params);
   }
})->setName('aaaa');

Some better way?