What does the single colon mean in this PHP statement? -
it used slimframework. first argument router pattern , second should callback. teacher gave class cdapi
inside media
namespace. understand ::class
returns qualified class name resolution, concatenated part don't understand: ":getone"
. getone
function never saw colon used that, mean?
$app->get('/super', \cdapi::class . ':getone');
slim framework has routing feature called "container resolution", , that's you're seeing when see single colon. see slim docs:
https://www.slimframework.com/docs/objects/router.html
you not limited defining function routes. in slim there few different ways define route action functions.
in addition function, may use:
- container_key:method
- class:method
- an invokable class
- container_key
this functionality enabled slim’s callable resolver class. translates string entry function call.
their example:
$app->get('/', '\homecontroller:home');
Comments
Post a Comment