Hi,
if /dogs is for the collection and /dogs/@name for a specific dog
do you normally map to several classes like:
$f3->map('/dogs/','\api\dogs');
$f3->map('/dogs/@name','\api\dog');
Or is it common to implement some logic to handle both cases in one class:
function get(\base $f3){
if (isset($f3->get(@name)) ){
echo "I have to do something with a specific dog namend ..." . $f3->get(@name);
} else {
echo "It´s about the whole pack and their names are: ....";
}
}
The question comes up as both cases are about dogs from that I would say it should be the concern of
one class handling it. On the other hand I´d like to avoid ending with one big class where it´s getting
hard to see which route is bound to which part.
thank you !
– anatol