I'm using Silex Framework. I wrote a simple route resource loader that is used that way :
$app->register( new RouteCollectionLoaderProvider);
$app["mp.route_loader"]->append(array(
array(
"type"=>"yaml",
"path"=>__DIR__."/Resources/routes/routes.yml",
"prefix"=>"/",
)
));
the source code is here : https://github.com/Mparaiso/silex-extensions/blob/master/src/Mparaiso/Provider/RouteCollectionLoaderProvider.php
i'm able to load routes named the regular way ,for instance , in a yaml file
index:
pattern: /
defaults: {_controller: Controller\DefaultController::index }
but i'm unable to load controllers defined as services :
$app["my.controller"] = function(){ return new MyController;};
info:
pattern: /info
defaults: {_controller: my.controller:info }
what would it take to be able to use the controller as a service syntax in a resource file ?
thanks