Error message A dependency injection container is required to access the 'annotations' service and A dependency injection container is required to access the 'request' service
<?php
$router = new Phalcon\Mvc\Router(false); //$router = new RouterAnnotations(false);
$router->add("/api", array( "controller" => "index", "action" => "index" ));
// $router->addGet("/api/:controller/:action/:params" , array( // array( // "controller" => 1, // "action" => 2, // "params" => 3, // ) // ));
$router->add("/api/:controller" , array( array( "controller" => 1, "action" => "index",
)
))->via("GET");
$router->add("/api/:controller" , array( array( "controller" => 1, "action" => "index",
)
))->via("POST");
$router->add("/api/:controller/:params", array( array( "controller" => 1, "action" => "view", "params" => 3 ) ))->via("GET");
$router->add("/api/:controller/:params", array( array( "controller" => 1, "action" => "view", "params" => 3,
)
))->via("PUT");
$router->add("/api/:controller/:params", array( array( "controller" => 1, "action" => "view", "params" => 3,
)
))->via("DELETE");