epiphany icon indicating copy to clipboard operation
epiphany copied to clipboard

Mix of routing examples

Open MikeGrace opened this issue 13 years ago • 2 comments

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.

MikeGrace avatar Oct 03 '11 21:10 MikeGrace

I'm guessing it's getRoute()->run(); since that is what is being used in the OpenPhoto project.

MikeGrace avatar Oct 03 '11 21:10 MikeGrace

@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.

jmathai avatar Oct 03 '11 21:10 jmathai