Respect/Rest

Namespaced resource classes?

Closed this issue · 2 comments

This doesn't seem to work.

$r3->any('/article/*', 'My\Namespace\Resource\Test');

What seems to be the problem?

I can go out on a limb and try but you really would be helping me loads if you can throw me a bone or two.

You have an autoloader wired up right?

Class Test extends implements Routable right?

Class Test implements at least a get method?

Not a biggie but good practice and so suggested in the php manual, to save you on possible hiccups where it does come into play, the best way to reference Namespaces as a string is to double escape the namespace separators.

iow:

$r3->any('/article/*', 'My\\Namespace\\Resource\\Test');

Perhaps if you can elaborate on the "This doesn't seem to work" I might be more useful in helping you resolve the issue. To start what php version are you running and on what operating system. What gave you the impression that it is not working, what did you expect it it to do instead? Do you have any thoughts on what the matter might be?

Works for me...

@krillzip Is this still a problem or may we close it as resolved?