akrabat / slim3-skeleton

Simple Slim Framework 3 skeleton with Twig & Monolog
BSD 3-Clause "New" or "Revised" License
345 stars 99 forks source link

Syntax for calling a method in a route #7

Closed ghost closed 9 years ago

ghost commented 9 years ago

The syntax: 'App\Action\HomeAction:dispatch'

Where can I learn more about this? I have never encountered it before outside of a Slim3 context. Is this something unique to Slim/Pimple/FastRoute or this a feature in PHP5 that has eluded me?

I feel silly, but I would very much like to understand this seemingly simple syntactical detail.

Thank you very much for this skeleton. It is proving to be extremely helpful.

akrabat commented 9 years ago

This is part of Slim's CallableResolver.

ghost commented 9 years ago

Thank you very much, I appreciate the help.

piotr-cz commented 9 years ago

Just in case that somebody would be getting same error as was: Call to undefined function App\Action\HomeAction::dispatch()

make sure there is one semicolon, not two when defining a callable.