Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mix of routing examples #31

Open
MikeGrace opened this issue Oct 3, 2011 · 2 comments
Open

Mix of routing examples #31

MikeGrace opened this issue Oct 3, 2011 · 2 comments

Comments

@MikeGrace
Copy link
Contributor

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
Copy link
Contributor Author

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

@jmathai
Copy link
Owner

jmathai commented Oct 3, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants