Respect/Rest

Who implement By ou AuthBasic using ini configs?

Closed this issue · 5 comments

Hello there.
I'm setting up my routes using ini files, something like this:

[myRoute Respect\Rest\Routes\ClassName]
method = GET
pattern = /some/route
class = My\Class
constructorParams[] = [mapper]

But now I need implement some By or AuthBasic like doc examples.
Someone can help to do this?
Thanks

Have you tried using:

[myRoute Respect\Rest\Routes\ClassName]
method = GET
pattern = /some/route
class = My\Class
constructorParams[] = [mapper]
by[] = My\Class\Routine

This not works because the by method not exists in ClassName.
I think that is necessary implement some this like that.
But the by method is a callBack method. I don't know how implement it.

try to use appendRoutine[]; you should append a By class instance with a
callback defined.

using Respect\Config:

[authentication My\Authentication]
mapper = [mapper]

[authenticationRoutine Respect\Rest\Routines\By]
callback = [[authentication], check]

[adminRoute Respect\Rest\Routes\ClassName]
; route setup ...
appendRoutine[] = [authenticationRoutine]

you can use appendRoutine to execute validation or checks(By, When) on your
routes.
:)

On Fri, Nov 22, 2013 at 5:22 PM, William Espindola <notifications@github.com

wrote:

This not works because the by method not exists in ClassName.
I think that is necessary implement some this like that.


Reply to this email directly or view it on GitHubhttps://github.com//issues/100#issuecomment-29101203
.

Hey @wesleyvicthor "Agrega valor ao camarote"!
Work perfectly, thanks so much.