epiphany
epiphany copied to clipboard
Mix of routing examples
Some of the examples show to do the routing like
$router = new EpiRoute();
$router->get('/', array('MyClass', 'MyMethod'));
$router->run();
while others show
getRoute()->get('/', 'showEndpoints');
getRoute()->get('/version', 'showVersion');
getRoute()->run();
Which should be used?
Examples should be updated to reflect preferred method.
I'm guessing it's getRoute()->run();
since that is what is being used in the OpenPhoto project.
@MikeGrace, yup. Haven't updated the docs since adding the utility functions. get*()
is the preferred method of using the modules. You can definitely instantiate a new class if it works better with other libraries that you're using. The get*()
functions just make it easier and less code for most implementations.